random-source 0.3.0.2 → 0.3.0.4
raw patch · 4 files changed
+21/−15 lines, 4 filesdep ~basedep ~mtl
Dependency ranges changed: base, mtl
Files
- random-source.cabal +10/−8
- src/Data/Random/Internal/Words.hs +6/−5
- src/Data/Random/Source/DevRandom.hs +4/−1
- src/Data/Random/Source/PureMT.hs +1/−1
random-source.cabal view
@@ -1,12 +1,12 @@ name: random-source-version: 0.3.0.2+version: 0.3.0.4 stability: provisional cabal-version: >= 1.6 build-type: Simple -author: James Cook <james.cook@usma.edu>-maintainer: James Cook <james.cook@usma.edu>+author: James Cook <mokus@deepbondi.net>+maintainer: James Cook <mokus@deepbondi.net> license: PublicDomain homepage: https://github.com/mokus0/random-fu @@ -19,14 +19,16 @@ easy to define new entropy sources in a way that is naturally forward-compatible. .+ Changes in 0.3.0.4: Fixed a typo that broke building+ with MTL-1+ .+ Changes in 0.3.0.3: Fixes for GHC's deprecation+ of Foreign.unsafePerformIO+ . Changes in 0.3.0.2: Fixes for GHC 7.2.*'s crazy Template Haskell changes.- .- Changes in 0.3.0.1: None except setting dependency- on flexible-defaults >= 0.0.0.2. -tested-with: GHC == 6.8.3, GHC == 6.10.4, GHC == 6.12.3,- GHC == 7.0.4, GHC == 7.2.1, GHC == 7.2.2+tested-with: GHC == 7.4.2, GHC == 7.6.1 source-repository head type: git
src/Data/Random/Internal/Words.hs view
@@ -1,11 +1,12 @@-{-- - ``Data/Random/Internal/Words''- -}- -- |A few little functions I found myself writing inline over and over again. module Data.Random.Internal.Words where -import Foreign+import Data.Bits+import Data.Word+import Foreign.Marshal (allocaBytes)+import Foreign.Ptr (castPtr)+import Foreign.Storable (peek, pokeByteOff)+import System.IO.Unsafe (unsafePerformIO) -- TODO: add a build flag for endianness-invariance, or just find a way -- to make sure these operations all do the right thing without costing
src/Data/Random/Source/DevRandom.hs view
@@ -8,8 +8,11 @@ import Data.Random.Source +import Foreign.Marshal (allocaBytes)+import Foreign.Ptr (castPtr)+import Foreign.Storable (peek) import System.IO (openBinaryFile, hGetBuf, Handle, IOMode(..))-import Foreign+import System.IO.Unsafe (unsafePerformIO) -- |On systems that have it, \/dev\/random is a handy-dandy ready-to-use source -- of nonsense. Keep in mind that on some systems, Linux included, \/dev\/random
src/Data/Random/Source/PureMT.hs view
@@ -47,7 +47,7 @@ #ifndef MTL2 $(monadRandom- [d| instance MonadRandom (State PureMT) |] where+ [d| instance MonadRandom (State PureMT) where getRandomWord64 = withMTState randomWord64 getRandomDouble = withMTState randomDouble |])