-----------------------------------------------------------------------------
---
+-- |
-- Module : System.Random
-- Copyright : (c) The University of Glasgow 2001
--- License : BSD-style (see the file libraries/core/LICENSE)
+-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer : libraries@haskell.org
-- Stability : provisional
-- Portability : portable
--
--- $Id: Random.hs,v 1.1 2001/06/28 14:15:04 simonmar Exp $
---
-- Random numbers.
--
-----------------------------------------------------------------------------
module System.Random
(
- RandomGen(next, split)
+ RandomGen(next, split, genRange)
, StdGen
, mkStdGen
, Random ( random, randomR,
#ifdef __GLASGOW_HASKELL__
import GHC.Show ( showSignedInt, showSpace )
-import GHC.Read ( readDec )
+import Numeric ( readDec )
import GHC.IOBase ( unsafePerformIO, stToIO )
import System.Time ( getClockTime, ClockTime(..) )
#endif
class RandomGen g where
- next :: g -> (Int, g)
- split :: g -> (g, g)
+ next :: g -> (Int, g)
+ split :: g -> (g, g)
+ genRange :: g -> (Int,Int)
+
+ -- default mathod
+ genRange g = (minBound,maxBound)
data StdGen