úÎ!LKH§8      !"#$%&'()*+,-./01234567"(c) The University of Glasgow 2001;BSD-style (see the file LICENSE in the 'random' repository)libraries@haskell.orgstableportable TrustworthyHrandom3With a source of random number supply in hand, the L class allows the programmer to extract random values of a variety of types.Minimal complete definition:  and .randomTakes a range (lo,hi) and a random number generator gK, and returns a random value uniformly distributed in the closed interval [lo,hi]D, 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 hiW are ever produced, but they may be, depending on the implementation and the interval.random The same as 3, but using a default range determined by the type: For bounded types (instances of 8 , such as 9+), the range is normally the whole type.FFor fractional types, the range is normally the semi-closed interval [0,1).For :*, the range is (arbitrarily) the range of ;.randomPlural variant of T, producing an infinite list of random values instead of returning a new generator.randomPlural variant of T, producing an infinite list of random values instead of returning a new generator.random A variant of 4 that uses the global random number generator (see System.Random#globalrng).random A variant of 4 that uses the global random number generator (see System.Random#globalrng).randomThe  instance of  has a   of at least 30 bits.The result of repeatedly using  3 should be at least as statistically robust as the (Minimal Standard Random Number Generator described by [System.Random\#Park, System.Random\#Carta0]. Until more is known about implementations of  , all we require is that  d deliver generators that are (a) not identical and (b) independently robust in the sense just given.The < and = instances of ] provide a primitive way to save the state of a random number generator. It is required that > (? g) == g. In addition, @I may be used to map an arbitrary string (not necessarily one produced by ?) onto a value of type . In general, the = instance of  has the following properties: (It guarantees to succeed on any string. >It guarantees to consume only a finite portion of the string. EDifferent argument strings are likely to result in different results.random The class : provides a common interface to random number generators. randomThe   operation returns an ;9 that is uniformly distributed in the range returned by  3 (including both end points), and a new generator. randomThe  A operation yields the range of values returned by the generator.It is required that:If (a,b) =   g, then a < b. " always returns a pair of defined ;s."The second condition ensures that  i cannot examine its argument, and hence the value it returns can be determined only by the instance of C. That in turn allows an implementation to make a single call to  a to establish a generator's range, without being concerned that the generator returned by (say)  : might have a different range to the generator passed to  ./The default definition spans the full range of ;. randomThe  ÿ operation allows one to obtain two distinct random number generators. This is very useful in functional programs (for example, when passing a random number generator down to recursive calls), but very little work has been done on statistically robust implementations of   ([System.Random\#Burton, System.Random\#Hellekalek%] are the only examples we know of). random The function  N provides an alternative way of producing an initial generator, by mapping an ;] into a generator. Again, distinct arguments should be likely to produce distinct generators.Arandom5Produce an infinite list-equivalent of random values. random(Sets the global random number generator.random(Gets the global random number generator.randomApplies  d to the current global random generator, updates it with one of the results, and returns the other.random³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 = getStdRandom (randomR (1,6))Arandom E.g. '(:)' but subject to fusionrandomE.g. randomA  instance    B      !"#$%&'()*+,-./0123456789:;<=>?@AB=>C:DE:FG:HI:DJ:HKLM!random-1.1-3ypV4EIycgb35PKjTYYr5q System.RandomRandomrandomRrandomrandomRsrandoms randomRIOrandomIOStdGen RandomGennextgenRangesplitmkStdGen setStdGen getStdGen newStdGen getStdRandom $fReadStdGen $fShowStdGen$fRandomGenStdGen$fRandomCDouble$fRandomCFloat $fRandomFloat$fRandomDouble $fRandomBool $fRandomChar$fRandomCUIntMax$fRandomCIntMax$fRandomCUIntPtr$fRandomCIntPtr$fRandomCULLong$fRandomCLLong$fRandomCSigAtomic$fRandomCWchar $fRandomCSize$fRandomCPtrdiff$fRandomCULong $fRandomCLong $fRandomCUInt $fRandomCInt$fRandomCUShort$fRandomCShort$fRandomCUChar$fRandomCSChar $fRandomCChar$fRandomWord64$fRandomWord32$fRandomWord16 $fRandomWord8 $fRandomWord $fRandomInt64 $fRandomInt32 $fRandomInt16 $fRandomInt8 $fRandomInt$fRandomIntegerbaseGHC.EnumBoundedghc-prim GHC.TypesChar integer-gmpGHC.Integer.TypeIntegerIntGHC.ShowShowGHC.ReadRead Text.Readreadshowreads buildRandoms