This module defines the following instances:
instance RandomSource (ST s) (Gen s) instance RandomSource IO (Gen RealWorld)
data Gen s
State of the pseudo-random number generator.
RealWorld is deeply magical. It is primitive, but it is not
ptrArg). We never manipulate values of type
RealWorld; it's only used in the type system, to parameterise
Create a generator for variates using the given seed, of which up to 256 elements will be used. For arrays of less than 256 elements, part of the default seed will be used to finish initializing the generator's state.
initialize (singleton 42)
initialize (toList [4, 8, 15, 16, 23, 42])
If a seed contains fewer than 256 elements, it is first used
verbatim, then its elements are
xored against elements of the
default seed until 256 elements are reached.
If a seed contains exactly 258 elements, then the last two elements
are used to set the generator's initial state. This allows for
complete generator reproducibility, so that e.g.
gen' == gen in
the following example: