[Haskell-cafe] Monad transformer, liftIO

Michael Roth mroth at nessie.de
Fri Apr 3 12:49:36 EDT 2009


Hello list,

maybe I'm just stupid, I'm trying to do something like this:


	import Control.Monad
	import Control.Monad.Trans
	import Control.Monad.List

	foobar = do
	        a <- [1,2,3]
        	b <- [4,5,6]
	        liftIO $ putStrLn $ (show a) ++ " " ++ (show b)
        	return (a+b)

	main = do
		sums <- foobar
		print sums


But this apparently doesn't work... I'm total clueless how
to achieve the correct solution. Maybe my mental image
on the monad transformer thing is totally wrong?


Michael


More information about the Haskell-Cafe mailing list