HaskellWiki

Haskell | Wiki community | Recent changes
Random page | Special pages

 

Not logged in
Log in | Help

Talk:Monad

About some of that "Functor/Applicative/Monad" business, a little equivalence formula that's worked well for me goes like so:

    ap (return f) x == (return . f) =<< x == liftM f x == fmap f x

Just to refresh, (=<<) is the reversed bind. Also, 'ap' is the Monad version of the applicative operator, (<*>) - see the Control.Applicative module for more help.

Usually, I stay away from using liftM, since it's identical to fmap, only confined t Monads, as 'ap' is to (<*>). However, the other liftMn functions are a nice generalization of the zipWithn family to Monads. The benefits of that, I'll leave for another discussion.

BMeph 04:30, 11 March 2008 (UTC)

Retrieved from "http://www.haskell.org/haskellwiki/Talk:Monad"

This page has been accessed 206 times. This page was last modified 04:30, 11 March 2008. Recent content is available under a simple permissive license.