mersenne-random-pure64- Generate high quality pseudorandom numbers purely using a Mersenne Twister

CopyrightCopyright (c) 2008, Bertram Felgenhauer <>
MaintainerDon Stewart <>
PortabilityTested with: GHC 6.8.3
Safe HaskellNone




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.


Block type

Block functions

seedBlock :: Word64 -> MTBlock Source #

create a new MT block, seeded with the given Word64 value

nextBlock :: MTBlock -> MTBlock Source #

step: create a new MTBlock buffer from the previous one

lookupBlock :: MTBlock -> Int -> Word64 Source #

look up an element of an MT block

Misc functions

blockLen :: Int Source #

length of an MT block

mixWord64 :: Word64 -> Word64 Source #

MT's word mix function.

(MT applies this function to each Word64 from the buffer before returning it)