[Haskell-cafe] A question about "monad laws"
valgarv at gmx.net
Sat Mar 15 12:01:58 EDT 2008
> One thing that may help is that if you can prove that fmap is sane:
> fmap (f . g) = fmap f . fmap g
I get stuck after expanding the rhs into:
((return . f) <=< id) . ((return . g) <=< id)
> then the naturality of return is precisely its free theorem, and ditto
> for bind.
Care to develop? IIRC the free theorems have a certain parametericity
requirement (which probably holds in all interesting cases, but still sounds
like an additional assumption). I'm not too familiar with these, so a link
would be appreciated =)
> So perhaps this law:
> (f <=< g) . h === f <=< (g . h)
> is actually the fmap law in disguise?
Could be. Maybe the fmap law is this one in disguise ;)
Ariel J. Birnbaum
View this message in context: http://www.nabble.com/A-question-about-%22monad-laws%22-tp15411587p16069396.html
Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.
More information about the Haskell-Cafe