[project @ 2002-04-26 13:34:05 by simonmar]
[ghc-base.git] / System / Random.hs
index aa3ddf6..27fb7aa 100644 (file)
@@ -1,5 +1,5 @@
 -----------------------------------------------------------------------------
--- 
+-- |
 -- Module      :  System.Random
 -- Copyright   :  (c) The University of Glasgow 2001
 -- License     :  BSD-style (see the file libraries/core/LICENSE)
@@ -8,15 +8,13 @@
 -- 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,
@@ -47,14 +45,18 @@ import Data.IORef
 
 #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