packages feed

random 1.3.0 → 1.3.1

raw patch · 3 files changed

+15/−6 lines, 3 files

Files

CHANGELOG.md view
@@ -1,3 +1,7 @@+# 1.3.1++* Add missing `SplitGen` instance for `StateGen`: [#183](https://github.com/haskell/random/pull/183)+ # 1.3.0  * Improve floating point value generation and avoid degenerate cases: [#172](https://github.com/haskell/random/pull/172)
random.cabal view
@@ -1,6 +1,6 @@ cabal-version:      >=1.10 name:               random-version:            1.3.0+version:            1.3.1 license:            BSD3 license-file:       LICENSE maintainer:         core-libraries-committee@haskell.org
src/System/Random/Internal.hs view
@@ -127,8 +127,8 @@ -- -- Constructor is not exported, becasue it is important for implementation to enforce the -- invariant of the underlying byte array being of the exact same length as the generator has--- specified in `System.Random.Seed.SeedSize`. Use `System.Random.Seed.mkSize` and--- `System.Random.Seed.unSize` to get access to the raw bytes in a safe manner.+-- specified in `System.Random.Seed.SeedSize`. Use `System.Random.Seed.mkSeed` and+-- `System.Random.Seed.unSeed` to get access to the raw bytes in a safe manner. -- -- @since 1.3.0 newtype Seed g = Seed ByteArray@@ -484,7 +484,7 @@ -- @since 1.3.0 uniformByteArray ::      RandomGen g-  => Bool -- ^ Should byte array be allocted in pinned or unpinned memory.+  => Bool -- ^ Should byte array be allocated in pinned or unpinned memory.   -> Int -- ^ Number of bytes to generate   -> g -- ^ Pure pseudo-random numer generator   -> (ByteArray, g)@@ -610,7 +610,7 @@ -- -- @since 1.2.0 newtype StateGen g = StateGen { unStateGen :: g }-  deriving (Eq, Ord, Show, RandomGen, Storable, NFData)+  deriving (Eq, Ord, Show, RandomGen, SplitGen, Storable, NFData)  instance (RandomGen g, MonadState g m) => StatefulGen (StateGenM g) m where   uniformWord32R r _ = state (genWord32R r)@@ -950,7 +950,12 @@   --   -- There is a default implementation of 'isInRange' via 'Generic'. Other helper function   -- that can be used for implementing this function are `isInRangeOrd` and-  -- `isInRangeEnum`+  -- `isInRangeEnum`.+  --+  -- Note that the @isRange@ method from @Data.Ix@ is /not/ a suitable default+  -- implementation of 'isInRange'. Unlike 'isInRange', @isRange@ is not+  -- required to be symmetric, and many @isRange@ implementations are not+  -- symmetric in practice.   --   -- @since 1.3.0   isInRange :: (a, a) -> a -> Bool