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.
- 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)
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.
Generate a list of n random integers such that each entry occurs at most once. Each number in the list must be unique.