Date: 2014-02-06 09:59 pm (UTC)From: [personal profile] winterkoninkje
winterkoninkje: shadowcrane (clean) (Default)
Since we're talking about monads, it's not clear that generalizing the left-seminearring laws makes any sense. There's an inherent directional bias to (>>=) which gets in the way of this generalization. But if we're not generalizing the distributivity laws, then Maybe forms a right-seminearring just fine.

Is this what you had in mind: ma >>= (\a -> f a `mplus` g a) = (ma >>= f) `mplus` (ma >>= g)? If so, then this is definitely going to break for IO etc. Just consider ma = print "blah" >> mzero; one side of the proposed equation only prints once, whereas the other prints twice. So even if that happens to work out for Maybe, it's not really a solution to what MonadPlus should mean.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org

April 2019

S M T W T F S
 123456
78910111213
14151617181920
212223242526 27
282930    

Tags

Page generated 21 Jun 2025 05:37 am
Powered by Dreamwidth Studios