System.Random.TF.Init

tf-random-0.5: High-quality splittable pseudorandom number generator

Safe Haskell | None
Language | Haskell98

System.Random.TF.Init

Synopsis

- newTFGen :: IO TFGen
- mkTFGen :: Int -> TFGen
- mkSeedTime :: IO (Word64, Word64, Word64, Word64)
- mkSeedUnix :: IO (Word64, Word64, Word64, Word64)
- initTFGen :: IO TFGen

# Documentation

newTFGen :: IO TFGen #

Derive a new generator instance from the global RNG using split. This is the default way of obtaining a new RNG instance. Initial generator is seeded using `mkSeedUnix` on UNIX, and `mkSeedTime` otherwise. This should be eventually replaced with proper seeding.

mkTFGen :: Int -> TFGen #

Quick and dirty way of creating a deterministically seeded generator.

mkSeedTime :: IO (Word64, Word64, Word64, Word64) #

Use system time create the random seed. This method of seeding may not be relible.

mkSeedUnix :: IO (Word64, Word64, Word64, Word64) #

Use the UNIX special file `/dev/urandom` to create the seed. Inspired by `random-mwc`.

initTFGen :: IO TFGen #

Create a seed and used it to seed an instance of TFGen. Uses `mkSeedUnix` on UNIX, and `mkSeedTime` otherwise.