Hoogle Search
Within LTS Haskell 24.0 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
-
pcg-random System.Random.PCG.Unique Seed a PRNG with data from the system's fast source of pseudo-random numbers. All the caveats of withSystemRandom apply here as well.
withSystemRandom :: (Gen -> IO a) -> IO apcg-random System.Random.PCG.Unique Seed with system random number. ("/dev/urandom" on Unix-like systems, time otherwise).
-
mersenne-random System.Random.Mersenne Given an initialised SFMT generator, the MTRandom allows the programmer to extract values of a variety of types. Minimal complete definition: random.
getStdRandom :: (MTGen -> IO a) -> IO amersenne-random System.Random.Mersenne Uses the supplied function to get a value from the current global random generator, and updates the global generator with the new generator returned by the function. For example, rollDice gets a random integer between 1 and 6:
rollDice :: IO Int rollDice = getMTRandom (randomR (1,6))
-
one-liner-instances System.Random.OneLiner If a is a data type with a single constructor whose fields are all instances of Random, then GRandom a has a Random instance. Will one day be able to be used with DerivingVia syntax, to derive instances automatically. Only works with data types with single constructors. If you need it to work with types of multiple constructors, consider GRandomSum.
-
one-liner-instances System.Random.OneLiner No documentation available.
-
one-liner-instances System.Random.OneLiner If a is a data type whose fields are all instances of Random, then GRandom a has a Random instance. Will one day be able to be used with DerivingVia syntax, to derive instances automatically. A version of GRandom that works for data types with multiple constructors. If your type has only one constructor, it might be more performant to use GRandom. Note that the "ranged" variants are partial: if given a range of items made with different constructors, will be error!
GRandomSum :: a -> GRandomSum aone-liner-instances System.Random.OneLiner No documentation available.
gRandom :: (ADTRecord a, Constraints a Random, RandomGen g) => g -> (a, g)one-liner-instances System.Random.OneLiner random implemented by sequencing random for all components. Requires the type to have only a single constructor.
gRandomIO :: (ADTRecord a, Constraints a Random) => IO aone-liner-instances System.Random.OneLiner