On Wed, 24 Sep 2008, Iain Barnett wrote:

Hi,

I have a function, that produces a random number between two given numbers

rand :: Int -> Int -> IO Int
rand low high = getStdRandom (randomR (low,high))

If you only need arbitrary numbers, not really random ones, you should stay away from IO:
  http://www.haskell.org/haskellwiki/Humor/Erlk%C3%B6nig
  
http://www.haskell.org/haskellwiki/Haskell_programming_tips#Separate_IO_and_data_processing
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to