summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsimonmar <unknown>2001-08-29 10:49:28 +0000
committersimonmar <unknown>2001-08-29 10:49:28 +0000
commit0c256695d64365ef6857ff11a289375a3c45b8e3 (patch)
tree31dd04ee4ef09a26a96dc589f577bce365d88618
parentb48fe6085e2465d67506347cff90116a58851008 (diff)
downloadhaskell-0c256695d64365ef6857ff11a289375a3c45b8e3.tar.gz
[project @ 2001-08-29 10:49:28 by simonmar]
Add genRange method to class RandomGen, as per the revised Haskell 98 library report.
-rw-r--r--ghc/lib/std/Random.lhs14
1 files changed, 8 insertions, 6 deletions
diff --git a/ghc/lib/std/Random.lhs b/ghc/lib/std/Random.lhs
index a6c00550f4..1f19b201bf 100644
--- a/ghc/lib/std/Random.lhs
+++ b/ghc/lib/std/Random.lhs
@@ -1,5 +1,5 @@
% ------------------------------------------------------------------------------
-% $Id: Random.lhs,v 1.24 2001/02/28 00:01:03 qrczak Exp $
+% $Id: Random.lhs,v 1.25 2001/08/29 10:49:28 simonmar Exp $
%
% (c) The University of Glasgow, 1995-2000
%
@@ -19,7 +19,7 @@ world..
\begin{code}
module Random
(
- RandomGen(next, split)
+ RandomGen(next, split, genRange)
, StdGen
, mkStdGen
, Random ( random, randomR,
@@ -53,12 +53,14 @@ import Char ( isSpace, chr, ord )
\begin{code}
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)
-\end{code}
-\begin{code}
data StdGen
= StdGen Int Int