split package:random
Returns two distinct pseudo-random number generators.
Implementations should take care to ensure that the resulting
generators are not correlated.
Splits a pseudo-random number generator into two. Overwrites the
mutable pseudo-random number generator with one of the immutable
pseudo-random number generators produced by a
split function
and returns the other.
Splits a pseudo-random number generator into two. Overwrites the
mutable wrapper with one of the resulting generators and returns the
other as a new mutable generator.
Pseudo-random generators that can be split into two separate and
independent psuedo-random generators should provide an instance for
this type class.
Historically this functionality was included in the
RandomGen
type class in the
split function, however, few pseudo-random
generators possess this property of splittability. This lead the old
split function being usually implemented in terms of
error.