[Haskell-cafe] A question about "monad laws"
ajb at spamcop.net
ajb at spamcop.net
Sat Mar 15 05:43:13 EDT 2008
G'day all.
Quoting askyle <valgarv at gmx.net>:
> Yup: bind f = f <=< id -- whence you can say (>>=) = flip bind
Ah, yes.
> My point is that (as far as I can see) you cannot prove the properties of
> bind by only assuming identity and associativity for (<=<).
One thing that may help is that if you can prove that fmap is sane:
fmap (f . g) = fmap f . fmap g
then the naturality of return is precisely its free theorem, and ditto
for bind.
So perhaps this law:
(f <=< g) . h === f <=< (g . h)
is actually the fmap law in disguise?
Cheers,
Andrew Bromage
More information about the Haskell-Cafe
mailing list