[Haskell-cafe] A question about "monad laws"

Neil Mitchell ndmitchell at gmail.com
Mon Feb 11 08:38:57 EST 2008


Hi

> The following is one of the laws.
>
> (x >>= f) >>= g == x >>= (\v -> f v >>= g)

Or stated another way:

(x >>= f) >>= g == x >>= (f >>= g)

Now it should be easier to see that this is simply associativity. It's
easy enough to violate, if you want to - but I don't have any nice
simple examples to hand.

Thanks

Neil


More information about the Haskell-Cafe mailing list