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.

  1. createSystemRandom :: IO Gen

    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.

  2. withSystemRandom :: (Gen -> IO a) -> IO a

    pcg-random System.Random.PCG.Unique

    Seed with system random number. ("/dev/urandom" on Unix-like systems, time otherwise).

  3. class MTRandom a

    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.

  4. getStdRandom :: (MTGen -> IO a) -> IO a

    mersenne-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))
    

  5. newtype GRandom a

    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.

  6. GRandom :: a -> GRandom a

    one-liner-instances System.Random.OneLiner

    No documentation available.

  7. newtype GRandomSum a

    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!

  8. GRandomSum :: a -> GRandomSum a

    one-liner-instances System.Random.OneLiner

    No documentation available.

  9. 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.

  10. gRandomIO :: (ADTRecord a, Constraints a Random) => IO a

    one-liner-instances System.Random.OneLiner

    randomIO implemented by calling gRandom on the global seed.

Page 6 of many | Previous | Next