[Haskell-cafe] Newbie and working with IO Int and Int

Víctor A. Rodríguez victor at bit-man.com.ar
Tue Oct 17 12:21:38 EDT 2006


Hi all,

I'm really newbie to Haskell, and working on a program I'm trying to make
some testing.
I make some test on certain know values ( e.g. adding 10 to 15 must return
25) and some test on random values (eg. adding rnd1 to rnd2 must return
rnd1+rnd2).

The problem that makes me mad is the random number generation. I can obtain
random numbers through module Random but all of them return IO Int values
(all I need are Ints) instead of Int.
I know that I can adjust my own functions to use IO Int instead of Int but
the call to certain functions must contain Int parameters, because these
ones can't be changed to accept IO Int (I read
http://haskell.org/hawiki/ThatAnnoyingIoType and know that can convert from
IO Int to Int :-P).

How can I deal with this problem ??

Thanks in advance.
--
Víctor A. Rodríguez (http://www.bit-man.com.ar)
El bit Fantasma (Bit-Man)
Perl Mongers Capital Federal (http://cafe.pm.org/)
GNU/Linux User Group - FCEyN - UBA (http://glugcen.dc.uba.ar/)



More information about the Haskell-Cafe mailing list