The Haskell 1.4 Library Report
top | back | next | contents

17  Random Numbers


module Random( random ) where

random    :: (Integer,Integer) -> Integer -> [Integer]
randomIO  :: (Integer,Integer) -> IO [Integer]

The Random library is a standard interface to a random value generator. The random function takes two arguments, a pair of integers (l,h) which represents the range of the random values that are to be generated, and an integer seed. It produces a list of random values as its result. The range of values is exactly as given by the range operation, that is [l..h]. The error function is called if this range is empty. The randomIO function is similar to random except that it obtains an initial seed in some system-dependent manner.


The Haskell 1.4 Library Report
top | back | next | contents
April 4, 1997