[Haskell-cafe] IO (Either a Error) question

Eugeny N Dzhurinsky bofh at redwerk.com
Sat May 1 17:37:13 EDT 2010


I have some sort of strange question:

assume that there are 2 functions

func1 :: Int -> IO (Either Error String)
func2 :: String -> IO (Either Error [String])

in case if there will be no IO involved, I could use
Control.Monad.Either and write something like

runCalc :: Int -> IO (Either Error [String])
runCalc param = func1 param >>= func2

but with that IO stuff I can't simply do in this way. Can somebody please
suggest, how to combine IO and Either monads, if that's even possible?

Thank you in advance!

Eugene Dzhurinsky
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20100501/e7d0cd6f/attachment.bin

More information about the Haskell-Cafe mailing list