[project @ 2002-04-24 16:31:37 by simonmar]
[haskell-directory.git] / System / Random.hs
index aa3ddf6..59ff300 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,7 +8,7 @@
 -- Stability   :  provisional
 -- Portability :  portable
 --
--- $Id: Random.hs,v 1.1 2001/06/28 14:15:04 simonmar Exp $
+-- $Id: Random.hs,v 1.4 2002/04/24 16:31:45 simonmar Exp $
 --
 -- Random numbers.
 --
@@ -16,7 +16,7 @@
 
 module System.Random
        (
-         RandomGen(next, split)
+         RandomGen(next, split, genRange)
        , StdGen
        , mkStdGen
        , Random ( random,   randomR,
@@ -47,14 +47,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