packages feed

random-mhs 1.3.2 → 1.3.2.1

raw patch · 3 files changed

+17/−14 lines, 3 filesdep ~data-array-bytePVP ok

version bump matches the API change (PVP)

Dependency ranges changed: data-array-byte

API changes (from Hackage documentation)

Files

README.md view
@@ -4,8 +4,8 @@  ### MHS version This a fork of the `random` package to be able to compile it with MicroHs.-The `random` package maintainers do not want to make these changes.-The package still works with GHC.+The `random` package maintainers do not want to these changes.+This package still works with GHC.  ### Description 
random-mhs.cabal view
@@ -1,6 +1,6 @@ cabal-version:      >=1.10 name:               random-mhs-version:            1.3.2+version:            1.3.2.1 license:            BSD3 license-file:       LICENSE maintainer:         lennart@augustsson.net@@ -108,7 +108,7 @@         transformers >=0.4 && <0.7,         splitmix >=0.1 && <0.2     if impl(ghc < 9.4)-      build-depends: data-array-byte >= 0.1 && < 9.9+      build-depends: data-array-byte <9.9  test-suite legacy-test     type:             exitcode-stdio-1.0
src/System/Random/Array.hs view
@@ -238,14 +238,15 @@ {-# INLINE writeArray #-}  #else /* !defined(__MHS__) */-import qualified Data.Array as A import Data.Array.Byte import Data.Bits import Data.ByteString(ByteString)-import Data.ByteString.Short.Internal-import qualified Data.STArray as SA+import Data.ByteString.Short.Internal(ShortByteString, fromShort, toShort) import Data.Word+import qualified Mhs.Arr as A+import qualified Mhs.MutArr as SA import GHC.Exts(unsafeIOToST)+import System.IO.Unsafe(unsafePerformIO)  wordSizeInBits :: Int wordSizeInBits = _wordSize@@ -280,23 +281,25 @@  -------- -type Array a = A.Array Int a-type MutableArray s a = SA.STArray s a+type Array a = A.Arr a+type MutableArray s a = SA.MutSTArr s a  newMutableArray :: Int -> a -> ST s (MutableArray s a)-newMutableArray = SA.newSTArray+newMutableArray = SA.newMutSTArr  freezeMutableArray :: MutableArray s a -> ST s (Array a)-freezeMutableArray = SA.freezeSTArray+freezeMutableArray a = A.copyArr <$> A.unsafeFreezeMutSTArr a  sizeOfMutableArray :: MutableArray s a -> Int-sizeOfMutableArray = SA.sizeSTArray+sizeOfMutableArray (SA.MutSTArr a) = unsafePerformIO (SA.sizeMutIOArr a)  readArray :: MutableArray s a -> Int -> ST s a-readArray = SA.readSTArray+readArray a i | i < 0 || i >= sizeOfMutableArray a = error "readArray"+              | otherwise = SA.unsafeReadMutSTArr a i  writeArray :: MutableArray s a -> Int -> a -> ST s ()-writeArray = SA.writeSTArray+writeArray a i x | i < 0 || i >= sizeOfMutableArray a = error "writeArray"+                 | otherwise = SA.unsafeWriteMutSTArr a i x  #endif /* !defined(__MHS__) */