[Haskell-cafe] Functors [Comments from OCaml Hacker Brian Hurt]

Jonathan Cast jonathanccast at fastmail.fm
Sun Jan 18 12:49:27 EST 2009


On Sun, 2009-01-18 at 11:23 +0000, Andrew Coppin wrote:
> Jonathan Cast wrote:
> > On Sat, 2009-01-17 at 12:04 +0000, Andrew Coppin wrote:
> >   
> >>
> >>> instance (Monad m) => Functor m where
> >>>   fmap f ma = do a <- ma; return (f a)
> >>>   
> >>>       
> >> While that's quite interesting from a mathematical point of view, how is 
> >> this "useful" for programming purposes?
> >>     
> >
> > Good Lord.  fmap (as above) is *at least* useful enough to be in the
> > standard library!  (Control.Monad.liftM).
> 
> Given that liftM exists, why is having an identical implementation for 
> fmap useful?

What?

jcc




More information about the Haskell-Cafe mailing list