[Haskell-cafe] Re: what is inverse of mzero and return?
k.schupke at imperial.ac.uk
Sat Jan 22 15:20:02 EST 2005
Ashley Yakeley wrote:
>In article <41F211FB.3030706 at imperial.ac.uk>,
> Keean Schupke <k.schupke at imperial.ac.uk> wrote:
>>This fits the above description, but I don't see how the following can
>> (mplus a b) >>= c = mplus (a >>= c) (b >>= c)
>Try it (and my test code) with , which is an instance of MonadPlus.
>mplus is defined as (++) for .
but what if (a >>= c) causes c to fail, and (b >>= c) lets c succeed. In
case the LHS will fail, whereas the RHS will succeed I think?
More information about the Haskell-Cafe