haskell / mwc-random

A very fast Haskell library for generating high quality pseudo-random numbers.
http://hackage.haskell.org/package/mwc-random
BSD 2-Clause "Simplified" License
54 stars 25 forks source link

Proposal : export acquireSeedSystem #64

Closed OlivierSohn closed 6 years ago

OlivierSohn commented 6 years ago

In my use case, I need to deterministically test a randomized algorithm. Hence, I need a few different seeds which are generated from the same source of randomness than when using withSystemRandom.

And I don't want to rely on the default seed (or on an xor-ed part of it), since the characteristics of the source used to generate it is unknown (see #32).

Shimuuar commented 6 years ago

That's very reasonable. I'll make release when I get time

OlivierSohn commented 6 years ago

Thanks!

Shimuuar commented 6 years ago

I think that createSystemRandom will achieve what you want. (Or save =<< createSystemRandom if you want to save seed). Is that right?

OlivierSohn commented 6 years ago

Right, didn't think of that, thanks for the suggestion!