Hoogle Search

Within LTS Haskell 12.18 (ghc-8.4.4)

  1. random :: (Random a, RandomGen g) => g -> (a, g)

    random System.Random

    The same as randomR, but using a default range determined by the type:

    • For bounded types (instances of Bounded, such as Char), the range is normally the whole type.
    • For fractional types, the range is normally the semi-closed interval [0,1).
    • For Integer, the range is (arbitrarily) the range of Int.

  2. random :: (Random a, RandomGen g) => g -> (a, g)

    tf-random System.Random.TF.Instances

    No documentation available.

  3. module System.Random

    This library deals with the common task of pseudo-random number generation. The library makes it possible to generate repeatable results, by starting with a specified initial random number generator, or to get different results on each run by using the system-initialised generator or by supplying a seed from some other source. The library is split into two layers:

    • A core random number generator provides a supply of bits. The class RandomGen provides a common interface to such generators. The library provides one instance of RandomGen, the abstract data type StdGen. Programmers may, of course, supply their own instances of RandomGen.
    • The class Random provides a way to extract values of a particular type from a random number generator. For example, the Float instance of Random allows one to generate random values of type Float.
    This implementation uses the Portable Combined Generator of L'Ecuyer [System.Random\#LEcuyer] for 32-bit computers, transliterated by Lennart Augustsson. It has a period of roughly 2.30584e18.

  4. class Random a

    random System.Random

    With a source of random number supply in hand, the Random class allows the programmer to extract random values of a variety of types. Minimal complete definition: randomR and random.

  5. class Random a

    tf-random System.Random.TF.Instances

    No documentation available.

  6. module TextShow.System.Random

    TextShow instances for StdGen. Since: 2

  7. randomIO :: Random a => IO a

    random System.Random

    A variant of random that uses the global random number generator (see System.Random#globalrng).

  8. randomR :: (Random a, RandomGen g) => (a, a) -> g -> (a, g)

    random System.Random

    Takes a range (lo,hi) and a random number generator g, and returns a random value uniformly distributed in the closed interval [lo,hi], together with a new generator. It is unspecified what happens if lo>hi. For continuous types there is no requirement that the values lo and hi are ever produced, but they may be, depending on the implementation and the interval.

  9. randomRIO :: Random a => (a, a) -> IO a

    random System.Random

    A variant of randomR that uses the global random number generator (see System.Random#globalrng).

  10. randomRs :: (Random a, RandomGen g) => (a, a) -> g -> [a]

    random System.Random

    Plural variant of randomR, producing an infinite list of random values instead of returning a new generator.

Page 1 of many | Next