Hoogle Search

Within LTS Haskell 12.18 (ghc-8.4.4)

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

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

  3. class Random a

    tf-random System.Random.TF.Instances

    No documentation available.

  4. module TextShow.System.Random

    TextShow instances for StdGen. Since: 2

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

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

    tf-random System.Random.TF.Instances

    No documentation available.

  7. class RandomGen g

    random System.Random

    The class RandomGen provides a common interface to random number generators.

  8. class RandomGen g

    tf-random System.Random.TF.Gen

    Alternative RandomGen class with a modified next operation, and added splitn and level operations. Using the generator requires that no more than one operation is called on the same generator state, as the implementation does not guarantee pseudorandomness otherwise. As an exception, calling splitn many times on the same generator state is allowed as long as the 'bits' argument is the same for all the calls.

  9. randomIO :: Random a => IO a

    random System.Random

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

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

Page 1 of many | Next