[Haskell-cafe] fmap vs. liftM

Henning Thielemann lemming at henning-thielemann.de
Tue Feb 5 09:20:36 EST 2008


On Tue, 5 Feb 2008, Brandon S. Allbery KF8NH wrote:

> On Feb 5, 2008, at 8:31 , Henning Thielemann wrote:
>
> > How do you convince the compiler that
> >   'join (fmap return x) == x' ?
>
> How do you convince it that the current formulation of Monad obeys
> the monad laws?  (rhetorical)

My point was that the constraint 'liftM == fmap' cannot be expressed in
Haskell 98, and the answer by Miguel suggested that it would be possible
by a different design of class Monad. The above was my objection to this
suggestion.


More information about the Haskell-Cafe mailing list