[Haskell-cafe] Re: Tutorial uploaded

Udo Stenzel u.stenzel at web.de
Thu Dec 22 20:57:38 EST 2005


Paul Moore wrote:
> Not trying to fan the flames, but one thing I struggle with is
> understanding (at a "gut level" - if you explain the theory, I'll
> understand, but go away none the wiser in practice...) why I need mapM
> as well as map (and all the other -M functions, liftM, foldM, etc...)

All you really need to understand is what

 sequence :: Monad m => [m a] -> m [a]

does.  Once you get that, the difference between map and mapM is clear
because of

 mapM f xs = sequence (map f xs)


Udo.
-- 
Worrying is like rocking in a rocking chair -- It gives
you something to do, but it doesn't get you anywhere.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org//pipermail/haskell-cafe/attachments/20051223/e91a6a57/attachment-0001.bin


More information about the Haskell-Cafe mailing list