[Haskell-cafe] Re: Functors [Comments from OCaml Hacker Brian
Hurt]
Jonathan Cast
jonathanccast at fastmail.fm
Sun Jan 18 12:50:26 EST 2009
On Sun, 2009-01-18 at 11:11 +0000, Andrew Coppin wrote:
> Heinrich Apfelmus wrote:
> > 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?
> >>
> >
> > Surely, you agree that liftM is "useful"? Because that's the same thing.
> >
>
> Then why not just use liftM? (That way, you know what it does...)
I'd be willing to say *you* don't `know what it does', if you haven't
figured out that it's an acceptable implementation of fmap first.
jcc
More information about the Haskell-Cafe
mailing list