mersenne-random-pure64 0.2.0.4 → 0.2.0.5
raw patch · 4 files changed
+25/−10 lines, 4 files
Files
- System/Random/Mersenne/Pure64.hs +2/−7
- System/Random/Mersenne/Pure64/Internal.hs +20/−0
- System/Random/Mersenne/Pure64/MTBlock.hs +1/−2
- mersenne-random-pure64.cabal +2/−1
System/Random/Mersenne/Pure64.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE CPP, ForeignFunctionInterface #-}+{-# OPTIONS_GHC -fno-warn-orphans #-} -------------------------------------------------------------------- -- | -- Module : System.Random.Mersenne.Pure64@@ -43,6 +44,7 @@ ------------------------------------------------------------------------ import System.Random.Mersenne.Pure64.MTBlock+import System.Random.Mersenne.Pure64.Internal import System.Random import Data.Word import Data.Int@@ -110,13 +112,6 @@ mt | i < blockLen-1 = PureMT block (i+1) nxt | otherwise = mkPureMT nxt {-# INLINE randomWord64 #-}---- | 'PureMT', a pure mersenne twister pseudo-random number generator----data PureMT = PureMT {-# UNPACK #-} !MTBlock {-# UNPACK #-} !Int MTBlock--instance Show PureMT where- show _ = show "<PureMT>" -- create a new PureMT from an MTBlock mkPureMT :: MTBlock -> PureMT
+ System/Random/Mersenne/Pure64/Internal.hs view
@@ -0,0 +1,20 @@+{-# LANGUAGE MagicHash #-}+module System.Random.Mersenne.Pure64.Internal+ ( PureMT(..)++ , blockLen+ , blockSize+ , MTBlock(..)+ ) where++import GHC.Exts+import System.Random.Mersenne.Pure64.Base++-- | 'PureMT', a pure mersenne twister pseudo-random number generator+--+data PureMT = PureMT {-# UNPACK #-} !MTBlock {-# UNPACK #-} !Int MTBlock++instance Show PureMT where+ show _ = show "<PureMT>"++data MTBlock = MTBlock ByteArray#
System/Random/Mersenne/Pure64/MTBlock.hs view
@@ -37,8 +37,7 @@ #endif import GHC.Word import System.Random.Mersenne.Pure64.Base--data MTBlock = MTBlock ByteArray#+import System.Random.Mersenne.Pure64.Internal allocateBlock :: IO MTBlock allocateBlock =
mersenne-random-pure64.cabal view
@@ -1,5 +1,5 @@ name: mersenne-random-pure64-version: 0.2.0.4+version: 0.2.0.5 homepage: http://code.haskell.org/~dons/code/mersenne-random-pure64/ synopsis: Generate high quality pseudorandom numbers purely using a Mersenne Twister description:@@ -40,6 +40,7 @@ exposed-modules: System.Random.Mersenne.Pure64 System.Random.Mersenne.Pure64.Base System.Random.Mersenne.Pure64.MTBlock+ System.Random.Mersenne.Pure64.Internal extensions: CPP, ForeignFunctionInterface if flag(small_base)