[Haskell-cafe] Monad transformer, liftIO

Andrew Wagner wagner.andrew at gmail.com
Fri Apr 3 13:14:33 EDT 2009


You haven't really said what happens when you try this, but I would bet that
things would be clarified greatly if you put type signatures on your two
definitions.

On Fri, Apr 3, 2009 at 12:49 PM, Michael Roth <mroth at nessie.de> wrote:

> 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
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090403/29af79ac/attachment.htm


More information about the Haskell-Cafe mailing list