MT19937.Pure
Description
Efficient, pure, standard 32-bit MT19937 Mersenne Twister implementation.
data MT19937 Source #
MT19937 state, holding the state vector and the current index.
Defined in MT19937.Pure
Methods
showsPrec :: Int -> MT19937 -> ShowS #
show :: MT19937 -> String #
showList :: [MT19937] -> ShowS #
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).