
15 Mar
2008
15 Mar
'08
5:43 a.m.
G'day all.
Quoting askyle
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