packages feed

pcg-random 0.1.0.0 → 0.1.0.1

raw patch · 7 files changed

+31/−7 lines, 7 filesPVP: minor bump suggested

API additions: PVP suggests at least a minor version bump

API changes (from Hackage documentation)

+ System.Random.PCG: instance Constructor C1_0FrozenGen
+ System.Random.PCG: instance Data FrozenGen
+ System.Random.PCG: instance Datatype D1FrozenGen
+ System.Random.PCG: instance Generic FrozenGen
+ System.Random.PCG: instance Typeable FrozenGen
+ System.Random.PCG.Fast: instance Constructor C1_0FrozenGen
+ System.Random.PCG.Fast: instance Data FrozenGen
+ System.Random.PCG.Fast: instance Datatype D1FrozenGen
+ System.Random.PCG.Fast: instance Generic FrozenGen
+ System.Random.PCG.Fast: instance Typeable FrozenGen
+ System.Random.PCG.Single: instance Constructor C1_0FrozenGen
+ System.Random.PCG.Single: instance Data FrozenGen
+ System.Random.PCG.Single: instance Datatype D1FrozenGen
+ System.Random.PCG.Single: instance Generic FrozenGen
+ System.Random.PCG.Single: instance Typeable FrozenGen

Files

+ CHANGELOG.md view
@@ -0,0 +1,4 @@+### 0.1.0.1++* Fix bug when dealing with `Word` and `Int` types.+
README.md view
@@ -1,6 +1,7 @@ ## pcg-random  [![Build Status](https://travis-ci.org/cchalmers/pcg-random.svg)](https://travis-ci.org/cchalmers/pcg-random)+[![Hackage](https://img.shields.io/hackage/v/pcg-random.svg?style=flat)](https://hackage.haskell.org/package/pcg-random)  Haskell bindings to the PCG random number generator http://www.pcg-random.org. @@ -8,7 +9,7 @@  Implements the standard multiple stream generator as well as the fast, single and unique variants. -The api is very similar to [mwc-random] but the pcg generator appears to be faster. There is also a pure interface via the [random] libray.+The api is very similar to [mwc-random] but the pcg generator appears to be slightly faster. There is also a pure interface via the [random] libray.  [mwc-random]: https://hackage.haskell.org/package/mwc-random [random]: http://hackage.haskell.org/package/random
pcg-random.cabal view
@@ -1,5 +1,5 @@ name:                pcg-random-version:             0.1.0.0+version:             0.1.0.1 synopsis:            Haskell bindings to the PCG random number generator. description:   PCG is a family of simple fast space-efficient statistically good@@ -18,7 +18,7 @@  license:             BSD3 license-file:        LICENSE-extra-source-files:  README.md c/LICENSE.txt+extra-source-files:  README.md CHANGELOG.md c/LICENSE.txt author:              Christopher Chalmers maintainer:          c.chalmers@me.com Homepage:            http://github.com/cchalmers/pcg-random
src/System/Random/PCG.hs view
@@ -1,4 +1,6 @@ {-# LANGUAGE CPP                        #-}+{-# LANGUAGE DeriveDataTypeable         #-}+{-# LANGUAGE DeriveGeneric              #-} {-# LANGUAGE FlexibleInstances          #-} {-# LANGUAGE ForeignFunctionInterface   #-} {-# LANGUAGE TypeFamilies               #-}@@ -50,9 +52,11 @@   , uniformF, uniformD, uniformBool   ) where +import Data.Data import Control.Applicative import Control.Monad.Primitive import Foreign+import GHC.Generics import System.IO.Unsafe import System.Random @@ -69,7 +73,7 @@  -- | Immutable snapshot of the state of a 'Gen'. data FrozenGen = FrozenGen {-# UNPACK #-} !Word64 {-# UNPACK #-} !Word64-  deriving (Show, Eq, Ord)+  deriving (Show, Eq, Ord, Data, Typeable, Generic)  -- | Save the state of a 'Gen' in a 'FrozenGen'. save :: PrimMonad m => Gen (PrimState m) -> m FrozenGen
src/System/Random/PCG/Class.hs view
@@ -35,6 +35,10 @@   , sysRandom   ) where +#if defined(__GLASGOW_HASKELL__) && !defined(__HADDOCK__)+#include "MachDeps.h"+#endif+ import           Control.Monad import           Data.Bits import           Data.Int
src/System/Random/PCG/Fast.hs view
@@ -1,4 +1,6 @@ {-# LANGUAGE CPP                        #-}+{-# LANGUAGE DeriveDataTypeable         #-}+{-# LANGUAGE DeriveGeneric              #-} {-# LANGUAGE FlexibleInstances          #-} {-# LANGUAGE ForeignFunctionInterface   #-} {-# LANGUAGE TypeFamilies               #-}@@ -16,7 +18,7 @@ -- Portability: CPP, FFI -- -- Fast variant of the PCG random number generator. This module performs--- around 20% faster the multiple streams version but produces slightly+-- around 20% faster than the multiple streams version but produces slightly -- lower quality (still good) random numbers. -- -- See <http://www.pcg-random.org> for details.@@ -53,7 +55,9 @@  import Control.Applicative import Control.Monad.Primitive+import Data.Data import Foreign+import GHC.Generics import System.IO.Unsafe import System.Random @@ -68,8 +72,10 @@ -- Seed ------------------------------------------------------------------------ +-- | Immutable state of a random number generator. Suitable for storing+--   for later use. newtype FrozenGen = FrozenGen Word64-  deriving (Show, Eq, Ord, Storable)+  deriving (Show, Eq, Ord, Storable, Data, Typeable, Generic)  -- | Save the state of a 'Gen' in a 'Seed'. save :: PrimMonad m => Gen (PrimState m) -> m FrozenGen
src/System/Random/PCG/Single.hs view
@@ -1,4 +1,6 @@ {-# LANGUAGE CPP                        #-}+{-# LANGUAGE DeriveDataTypeable         #-}+{-# LANGUAGE DeriveGeneric              #-} {-# LANGUAGE FlexibleInstances          #-} {-# LANGUAGE ForeignFunctionInterface   #-} {-# LANGUAGE TypeFamilies               #-}@@ -52,9 +54,12 @@  import Control.Applicative import Control.Monad.Primitive+import Data.Data import Foreign+import GHC.Generics import System.IO.Unsafe import System.Random+ import System.Random.PCG.Class  -- $setup@@ -67,7 +72,7 @@ ------------------------------------------------------------------------  newtype FrozenGen = FrozenGen Word64-  deriving (Show, Eq, Ord, Storable)+  deriving (Show, Eq, Ord, Storable, Data, Typeable, Generic)  -- | Save the state of a 'Gen' in a 'Seed'. save :: PrimMonad m => Gen (PrimState m) -> m FrozenGen