
2 Apr
2002
2 Apr
'02
9:03 a.m.
Peter Rooney
I can't seem to generate random numbers.
Depending on why you need random numbers, you might want to consider using a fixed seed, i.e. a = randoms (mkStdGen 4711) will get you a sequence of "random" numbers. Of course, it will be the same sequence for every run of your program, but in some cases, (when you only want arbitrary data, and not necessarily random) this won't matter much. The advantage is, of course, that you get rid of the IO monad. I've toyed with the idea of using unsafePerformIO (at least to get the seed), but haven't quite dared (or needed) to yet. :-) -kzm -- If I haven't seen further, it is by standing in the footprints of giants