HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulemersenne-random-pure64-0.2.2.0Haskell98

System.Random.Mersenne.Pure64

A purely functional binding 64 bit binding to the classic mersenne twister random number generator. This is more flexible than the impure 'mersenne-random' library, at the cost of being a bit slower. This generator is however, many times faster than System.Random, and yields high quality randoms with a long period.

This generator may be used with System.Random, however, that is likely to be slower than using it directly.

  • 1 type
  • 7 values

The random number generator

1 declaration
datadata PureMT
#

PureMT, a pure mersenne twister pseudo-random number generator

Instances2Show, RandomGen
  • Show PureMTDefined in mersenne-random-pure64-0.2.2.0 · System.Random.Mersenne.Pure64.Internal
  • RandomGen PureMTDefined in mersenne-random-pure64-0.2.2.0 · System.Random.Mersenne.Pure64 · orphan

Introduction

2 declarations
valuenewPureMT :: IO PureMT
#

Create a new PureMT generator, using the clocktime as the base for the seed.

Being purely functional, the PureMT generator is an instance of RandomGen. However, it doesn't support split yet.

Low level access to the generator

5 declarations
valuerandomInt :: PureMT -> (Int, PureMT)
#

Yield a new Int value from the generator, returning a new generator and that Int. The full 64 bits will be used on a 64 bit machine.

Orphan instances

1 instance