
22 Aug
2008
22 Aug
'08
1:07 p.m.
Hello, I'm a bit perplexed by what it means to do something like "ap = liftM2 id" liftM2 :: (Monad m) => (a1 -> a2 -> r) -> m a1 -> m a2 -> m r id :: a -> a liftM2 id :: (Monad m) => m (a2 -> r) -> m a2 -> m r My intuitive understanding is that liftM2 is expecting a two-argument function as its first argument, so it seems a little unexpected to pass it "id", a one-argument function. And I can't really see how the type signature of "liftM2 id" is derived from "liftM2" and "id". Any help much appreciated! -- Matt