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.

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to