[Haskell-cafe] Lists and monads

Kevin Jardine kevinjardine at gmail.com
Mon Jul 26 08:52:56 EDT 2010


As a Haskell neophyte, one of the things I find confusing is the way
that the usual list functions (map, fold, ++, etc.) often cannot be
used directly with monadic lists (m [a] or [m a]) but seem to require
special purpose functions like ap, mapM etc.

I get the idea of separating pure and impure code but am constantly
frustrated by the fact that stuff that would be easy outside a monad
seems to get more difficult inside, especially list manipulation. As a
result I tend to write ugly recursive list functions that would be
more appropriate with Python, say.

I suspect that things are not quite as difficult as they appear,
however, but cannot find any tutorials on monadic list manipulation.

Any suggestions for resources in that area?

Kevin


More information about the Haskell-Cafe mailing list