[Haskell-cafe] Mersenne-random and standard random API

Yves Parès yves.pares at gmail.com
Wed Feb 8 22:56:58 CET 2012


Hi,
I've been in the past told that mersenne-random was much better than the
standard random package.

However, System.Random.Mersenne doesn't follow the general API described in
System.Random, MTGen is not an instance of RandomGen.
But a sample on System.Random.Mersenne.getStdRandom documentation (
http://hackage.haskell.org/packages/archive/mersenne-random/1.0.0.1/doc/html/System-Random-Mersenne.html)
indicates this:

  rollDice :: IO Int
  rollDice = getMTRandom (randomR (1,6))

It looks like wrong documentation (checking of older versions show that
getMTRandom have never lived or been exposed by this module), but suggests
MTRandom should be an instance of RandomGen (if I assume well that randomR
is that of System.Random).

So is it possible to use the fast and efficient mersenne generator with the
convenient and general random API?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120208/c13204eb/attachment.htm>


More information about the Haskell-Cafe mailing list