Repository : ssh://darcs.haskell.org//srv/darcs/packages/random

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/aaae8071cb1b9db87643ccfb786fc88033025ef9

>---------------------------------------------------------------

commit aaae8071cb1b9db87643ccfb786fc88033025ef9
Author: Ryan Newton <[email protected]>
Date:   Sun Jun 26 23:51:11 2011 -0400

    Minor: using unsafeDupablePerformIO to be more fair to MWC.

>---------------------------------------------------------------

 Benchmark/SimpleRNGBench.hs |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/Benchmark/SimpleRNGBench.hs b/Benchmark/SimpleRNGBench.hs
index cc92d86..83ae72c 100644
--- a/Benchmark/SimpleRNGBench.hs
+++ b/Benchmark/SimpleRNGBench.hs
@@ -36,7 +36,8 @@ import BinSearch
 import System.Random.Mersenne.Pure64
 import System.Random.MWC
 import Control.Monad.Primitive
-import System.IO.Unsafe
+-- import System.IO.Unsafe
+import GHC.IO
 #endif
 
 
----------------------------------------------------------------------------------------------------
@@ -117,7 +118,8 @@ data MWCRNG = MWCRNG (Gen (PrimState IO))
 -- data MWCRNG = MWCRNG GenIO
 instance RandomGen MWCRNG where 
   -- For testing purposes we hack this to be non-monadic:
-  next g@(MWCRNG gen) = unsafePerformIO $
+--  next g@(MWCRNG gen) = unsafePerformIO $
+  next g@(MWCRNG gen) = unsafeDupablePerformIO $
    do v <- uniform gen
       return (v, g)
 #endif



_______________________________________________
Cvs-libraries mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-libraries

Reply via email to