[Haskell-beginners] Get things from IO monad

jianqiuchi at gmail.com jianqiuchi at gmail.com
Fri May 6 00:48:17 CEST 2011


Hi,

I have a silly question, Can i get things out of IO monad?

for example, function 'anotherFun' doesn't work.

genFunc :: IO String

anotherFunc :: (Monad m) => m String
-- m is a complex monad and is not an IO monad
-- m is not an instance of MonadIO so liftIO will not work
anotherFunc = do
genStr <- genFunc
return genStr


I just want to get something from IO monad and wrap it with some other  
monad. Is there anyway to do that? Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20110505/20abac1e/attachment.htm>


More information about the Beginners mailing list