Safe Haskell | None |
---|
Monad based on state for passing random number state around for GEP. The choice of Mersenne.Pure64 was for performance, and the pure version will play nicely with threading.
Author: mjsottile@computer.org
- type GEPMonad a = Rand a
- nextF :: Double -> Rand Double
- nextR :: Int -> Rand Int
- nextRDifferent :: Int -> Int -> Rand Int
- nextRList :: Int -> Int -> Rand [Int]
- nextRListUnique :: Int -> [Int] -> Int -> Rand [Int]
- nextRListPairs :: Int -> Int -> Rand [(Int, Int)]
- generatePairs :: Int -> Rand [(Int, Int)]
- runRmonad :: Rand a -> PureMT -> (a, PureMT)
Documentation
Generate a random number as a Double between 0.0 and the given upper bound.
Generate a random integer between 1 and the upper bound (inclusive).
Generate a random integer in the specified range that is NOT equal to the integer provided.
Generate a list of random integers.