ap f x = liftM2 id mf ma -- definition of ap
= do { f <- mf; a <- ma; return (id f x) } -- definition of liftM2
= do { f <- mf; a <- ma; return (f x) } -- definition of id, f x y = (f x) y
We can see that id applied to f gives f which is then applied to a.