[<<][meta][>>][..]
Mon Aug 8 15:59:40 CEST 2011
All this fuss over liftA2 ?
For a monad, is liftA2 the same as l1 or l2?
l1,l2 :: Monad m => (a -> b -> c) -> m a -> m b -> m c
l1 fn = \ma mb -> do
a <- ma
b <- mb
return fn a b
l2 fn = \ma mb -> do
b <- mb
a <- ma
return fn a b
It has to be one of the two, but which one? This depends on the
definition of <*> for a monad.
in [1] the liftM2 operation is defined with the same type. Is liftM2
the same as liftA2? It has to be..
[1] http://haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad.html#v:ap
[Reply][About][<<][meta][>>][..]