Simple IO Monad problem
Nick Name
nick.name at inwind.it
Sat Sep 13 01:25:39 EDT 2003
Alle 00:08, sabato 13 settembre 2003, kuq32tr02 at sneakemail.com ha
scritto:
> ERROR "./mailalias.lhs":5 - Type error in final generator
> *** Term : map putStrLn strs
> *** Type : [IO ()]
> *** Does not match : IO a
>
> Can someone please explain what I'm doing wrong?
This is a type error. You have to "mapM_", not map, see the types in the
documentation and try to convince yourself that you need an IO list and
not a list of IO, then that you really need an IO () and not an IO list
(wich would be returned by mapM). The syntax for a list of t in haskell
is [t], in case you didn't notice.
V.
More information about the Haskell-Cafe
mailing list