
9 Feb
2012
9 Feb
'12
10:59 a.m.
On 09.02.2012 01:56, Yves Parès wrote:
Hi, I've been in the past told that mersenne-random was much better than the standard random package.
...
So is it possible to use the fast and efficient mersenne generator with the convenient and general random API?
I think design of Random type class basically precludes efficient generators with large periods and consequently large state. Look at next function:
next :: g -> (Int, g)
It means that state has to be copied but for efficiency we want to mutate it in place. I consider Random type class a failure and ignore it. P.S. For monte-carlo and thing like that I'd recommend mwc-random it more featureful than mersenne-random and don't rely on global state