-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | random number library -- -- This package provides a basic random number generation library, -- including the ability to split random number generators. @package random @version 1.1 -- | 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: -- --
-- rollDice :: IO Int -- rollDice = getStdRandom (randomR (1,6)) --getStdRandom :: (StdGen -> (a, StdGen)) -> IO a -- | Gets the global random number generator. getStdGen :: IO StdGen -- | Sets the global random number generator. setStdGen :: StdGen -> IO () -- | Applies split to the current global random generator, updates -- it with one of the results, and returns the other. newStdGen :: IO StdGen -- | 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. class Random a -- | 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. randomR :: (Random a, RandomGen g) => (a, a) -> g -> (a, g) -- | The same as randomR, but using a default range determined by -- the type: -- -- random :: (Random a, RandomGen g) => g -> (a, g) -- | Plural variant of randomR, producing an infinite list of random -- values instead of returning a new generator. randomRs :: (Random a, RandomGen g) => (a, a) -> g -> [a] -- | Plural variant of random, producing an infinite list of random -- values instead of returning a new generator. randoms :: (Random a, RandomGen g) => g -> [a] -- | A variant of randomR that uses the global random number -- generator (see System.Random#globalrng). randomRIO :: Random a => (a, a) -> IO a -- | A variant of random that uses the global random number -- generator (see System.Random#globalrng). randomIO :: Random a => IO a instance System.Random.Random GHC.Integer.Type.Integer instance System.Random.Random GHC.Types.Int instance System.Random.Random GHC.Int.Int8 instance System.Random.Random GHC.Int.Int16 instance System.Random.Random GHC.Int.Int32 instance System.Random.Random GHC.Int.Int64 instance System.Random.Random GHC.Types.Word instance System.Random.Random GHC.Word.Word8 instance System.Random.Random GHC.Word.Word16 instance System.Random.Random GHC.Word.Word32 instance System.Random.Random GHC.Word.Word64 instance System.Random.Random Foreign.C.Types.CChar instance System.Random.Random Foreign.C.Types.CSChar instance System.Random.Random Foreign.C.Types.CUChar instance System.Random.Random Foreign.C.Types.CShort instance System.Random.Random Foreign.C.Types.CUShort instance System.Random.Random Foreign.C.Types.CInt instance System.Random.Random Foreign.C.Types.CUInt instance System.Random.Random Foreign.C.Types.CLong instance System.Random.Random Foreign.C.Types.CULong instance System.Random.Random Foreign.C.Types.CPtrdiff instance System.Random.Random Foreign.C.Types.CSize instance System.Random.Random Foreign.C.Types.CWchar instance System.Random.Random Foreign.C.Types.CSigAtomic instance System.Random.Random Foreign.C.Types.CLLong instance System.Random.Random Foreign.C.Types.CULLong instance System.Random.Random Foreign.C.Types.CIntPtr instance System.Random.Random Foreign.C.Types.CUIntPtr instance System.Random.Random Foreign.C.Types.CIntMax instance System.Random.Random Foreign.C.Types.CUIntMax instance System.Random.Random GHC.Types.Char instance System.Random.Random GHC.Types.Bool instance System.Random.Random GHC.Types.Double instance System.Random.Random GHC.Types.Float instance System.Random.Random Foreign.C.Types.CFloat instance System.Random.Random Foreign.C.Types.CDouble instance System.Random.RandomGen System.Random.StdGen instance GHC.Show.Show System.Random.StdGen instance GHC.Read.Read System.Random.StdGen