[Haskell-beginners] randmomR produces only even values
chaddai.fouche at gmail.com
Sun Nov 1 21:42:12 UTC 2015
I really don't think this is much of a flaw. It may need to be reinforced
that this package (and most random libraries) doesn't provide _any_
guarantee if you use it like that (restrain the first output with randomR
of lots of random generators initialized by very particular seeds sequence).
The guarantee the paper will be talking about will be for a sequence of
random numbers generated by one generator and this behave normally as shown
> (minimum &&& maximum) . map (length . filter even . take 1000 . randomRs
(1,10) . mkStdGen) $ [1..1000]
In other words, if there's any problem it is only one of documentation
(just a warning in the haddock ought to be sufficient).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Beginners