
3 Oct
2008
3 Oct
'08
2:30 p.m.
Andrew Coppin wrote:
(As an aside, Control.Monad.ap is not a function I've ever heard of. It seems simple enough, but what an unfortunate name...!) I think it makes sense. It stands for "apply," or at least that is what I think of when I see it. If we have a function f :: A -> B -> C -> D and values a :: m A, b :: m B, c :: m C, then we can do:
f `liftM` a `ap` b `ap` c ... which is the same as (using Applicative): f <$> a <*> b <*> c ... both having type m D. - Jake