I am trying to generate 10 random numbers in Haskell mkStdGen in the range of 0 (inclusive) to 100 (exclusive).
Something equivalent of the following Java code
Random ran = new Random();
ran.nextInt(100);
Note, I have to use mkStdGen
This is what I have so far
rand low high seed = fst (randomR (low, high) (mkStdGen seed))
randomlist :: Int -> Int -> Int -> [Int]
randomlist l h num = take num (map (rand l h) [0..])
Note that this isn’t really pseudorandom, because
mkStdGentakes an explicit seed.newStdGenwould be better, if you’re allowed to run inIO.