Closed glguy closed 3 years ago
Thanks for the report! It looks like that uniformR got somehow broken. Following program only prints 0-s.
step = do
gen <- createSystemRandom
replicateM_ 10 $ print =<< uniformR (0,6::Int) gen
Turns out it's CPP problem. Some include was dropped accidentally. WORD_SIZE_IN_BITS
is no longer is CPP macro and #if WORD_SIZE_IN_BITS < 64
evaluated as true so uniform for Int generates only 32 bits values in 64 bit platforms breaking uniformR along the way.
I would hope that it should be compile error.
c195ca081d08d2a838caf63ec1c0ec6b4830c1e9 should fix this problem I believe. I'll make a release tomorrow
0.15.0.1 is on hackage
This always prints
0
for me in 0.15 but it used to work in 0.14. Perhapsrestore
is broken? (my actual use-case saves the generator afterward back to a new seed)