
2 Oct
2008
2 Oct
'08
4:36 p.m.
--- On Thu, 10/2/08, Andrew Coppin
I'm lost...
(What does liftM have to do with fmap?)
They're (effectively) the same function. i.e. liftM :: (Monad m) => (a -> b) -> m a -> m b fmap :: (Functor f) => (a -> b) -> f a -> f b liftM turns a function from a to b into a function from m a to m b; fmap turns a function from a to b into a function from f a to f b; If your datatype with a Monad instance also has a Functor instance (which it *can* have, you just need to declare the instance), then liftM is equivalent to fmap.