Hi,
I don't understand what's taking place here.
>From Hoogle:
=================
liftM2 :: Monad m => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r
Promote a function to a monad, scanning the monadic arguments from left to
right. For example,
liftM2 (+) [0,1] [0,2] = [0,2,1,3]
liftM2 (+) (Just 1) Nothing = Nothing
=================
What does it mean to "promote a function to a monad?"
It would seem that the monad values must understand the function that's being
promoted, like Ints understand (+).
Prelude Control.Monad> liftM2 (+) (Just 1) (Just 1)
Just 2
But how does one add [0,1] and [0,2] to get [0,2,1,3]?
Michael
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe