-1

I write a simple Haskell program using Haste ( https://www.haste-lang.org/ ). I need to get a random number from range 1-100. How can I do this?

user983447
  • 1,598
  • 4
  • 19
  • 36

1 Answers1

1

randomRIO (1,100) :: IO Int would generate such a random number.

Note that since this is not a pure value, it can only be used inside the IO monad.

See the System.Random documentation for more information.

chi
  • 111,837
  • 3
  • 133
  • 218