[Haskell-beginners] Help! Trapped in the IO Monad!

Erik de Castro Lopo mle+cl at mega-nerd.com
Wed Jan 28 22:00:07 EST 2009


Alexander Dunlap wrote:

> Try removing the "return $" on the last line. foldM ... will already
> be in the IO monad; return will lift the IO a into the IO monad again,
> so you'll have IO (IO a), which you don't want.

Fantastic! Worked a treat.

Thanks,
Erik
-- 
-----------------------------------------------------------------
Erik de Castro Lopo
-----------------------------------------------------------------
"C++ has its place in the history of programming languages. Just
as Caligula has his place in the history of the Roman Empire."
-- Robert Firth


More information about the Beginners mailing list