3 ms·
It's called lifting because it's moving something between levels. In the case of liftM, it's moving a function that operates on type a and returns type b, to o
by dllthomas 13y ago
It's called lifting because it's moving something between levels. In the case of liftM, it's moving a function that operates on type a and returns type b, to one that operates on a wrapped type a and returns a wrapped type b. Since a monad should be a functor, and the types are the same, I'm pretty confident that this is the same thing as fmap - though in principle there could be a monad with no functor instance defined where you would have to use liftM (for now: http://www.haskell.org/haskellwiki/Functor-Applicative-Monad_Proposal http://www.haskell.org/haskellwiki/Functor-Applicative-Monad...).