[Haskell-cafe] Occurs check error, help!
Ivan Lazar Miljenovic
ivan.miljenovic at gmail.com
Sat Mar 20 19:21:21 EDT 2010
boblettoj <boblettoj99 at msn.com> writes:
> I was using a do loop to try and create a generator before using it in the
> randomR call, is there a better way to do this?
Use newStdGen in IO, then pass it around everywhere.
> randoms and randomRs return lists whereas i just want a single number.
> thanks
OK, I thought you were doing something with random ordering of lists
(note that if you want to shuffle some lists, there is a package on
Hackage that implements Oleg's perfect shuffling function).
--
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com
More information about the Haskell-Cafe
mailing list