[project @ 2002-05-09 13:16:29 by simonmar]
[ghc-base.git] / System / Random.hs
index aa3ddf6..e3fa8b9 100644 (file)
@@ -1,22 +1,20 @@
 -----------------------------------------------------------------------------
--- 
+-- |
 -- 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,
@@ -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