This is a function to generate a list of given number of random numbers within a range, but I’m confused on how to call on this function. I think a seed is needed for StdGen, but really appreciate if someone can tell how exactly to call this function.
randomList :: (Random a) => (a,a) -> Int -> StdGen -> [a]
randomList bnds n = take n . randomRs bnds
Sample:
will output e.g.
The
gis the random number generator, in this case the “global random number generator”.Here’s the documentation