Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Bumped version for recent bugfixes but disabled SplittableGen for now.

  • Loading branch information...
commit 40bbfd2867d70b85f5c607382c9f3ffa25761031 1 parent f9a348f
Ryan Newton rrnewton authored
Showing with 14 additions and 2 deletions.
  1. +8 −1 System/Random.hs
  2. +6 −1 random.cabal
9 System/Random.hs
View
@@ -46,9 +46,12 @@ module System.Random
-- * Random number generators
+#ifdef ENABLE_SPLITTABLEGEN
RandomGen(next, genRange)
, SplittableGen(split)
-
+#else
+ RandomGen(next, genRange, split)
+#endif
-- ** Standard random number generators
, StdGen
, mkStdGen
@@ -142,9 +145,11 @@ class RandomGen g where
-- default method
genRange _ = (minBound, maxBound)
+#ifdef ENABLE_SPLITTABLEGEN
-- | The class 'SplittableGen' proivides a way to specify a random number
-- generator that can be split into two new generators.
class SplittableGen g where
+#endif
-- |The 'split' operation allows one to obtain two distinct random number
-- generators. This is very useful in functional programs (for example, when
-- passing a random number generator down to recursive calls), but very
@@ -186,7 +191,9 @@ instance RandomGen StdGen where
next = stdNext
genRange _ = stdRange
+#ifdef ENABLE_SPLITTABLEGEN
instance SplittableGen StdGen where
+#endif
split = stdSplit
instance Show StdGen where
7 random.cabal
View
@@ -1,5 +1,8 @@
name: random
-version: 1.0.0.4
+version: 1.0.1.0
+
+-- 1.0.1.0 -- bump for bug fixes, but no SplittableGen yet
+
license: BSD3
license-file: LICENSE
maintainer: rrnewton@gmail.com
@@ -11,6 +14,8 @@ description:
build-type: Simple
Cabal-Version: >= 1.6
+
+
Library
exposed-modules:
System.Random
Please sign in to comment.
Something went wrong with that request. Please try again.