[Haskell-cafe] Convert IO Int to Int

Jochem Berndsen jochem at functor.nl
Tue Jun 9 06:33:52 EDT 2009


ptrash wrote:
> Hi,
> 
> I am using the System.Random method randomRIO. How can I convert its output
> to an Int?
> 
> Thanks...

You cannot [1], you should read up on monads and I/O in Haskell, for example
http://haskell.org/haskellwiki/IO_inside

[1] Yes, you can, but no, you don't want to.

Regards,

-- 
Jochem Berndsen | jochem at functor.nl
GPG: 0xE6FABFAB


More information about the Haskell-Cafe mailing list