mt19937-0.1.0: Efficient MT19937 (standard 32-bit Mersenne Twister PRNG) implementation in pure Haskell
Safe HaskellSafe-Inferred
LanguageGHC2021

MT19937.Pure

Description

Efficient, pure, standard 32-bit MT19937 Mersenne Twister implementation.

Synopsis

Documentation

data MT19937 Source #

MT19937 state, holding the state vector and the current index.

Instances

Instances details
Show MT19937 Source # 
Instance details

Defined in MT19937.Pure

init :: Word32 -> MT19937 Source #

Initialize an MT19937 with the given seed.

init' :: Word32 -> MT19937 Source #

Initialize an MT19937 with the given seed, without pre-twisting.

extract :: MT19937 -> (Word32, MT19937) Source #

Extract the next random byte and return the updated state.

skip :: Int -> MT19937 -> MT19937 Source #

Skip the given number of random bytes.

If the skips would result in multiple twists, we perform these in a single pass (rather than copying the array every twist).