smallarray 0.2.1 → 0.2.2
raw patch · 3 files changed
+10/−4 lines, 3 filesdep +bytestringdep ~hashable
Dependencies added: bytestring
Dependency ranges changed: hashable
Files
- Data/ByteArray.hs +4/−2
- Data/SmallArray/Internal.hs +1/−0
- smallarray.cabal +5/−2
Data/ByteArray.hs view
@@ -62,6 +62,7 @@ import Control.Monad.ST import Control.DeepSeq +import Data.ByteString.Internal (inlinePerformIO) import qualified Data.Hashable as H #if defined(USING_GHC)@@ -177,6 +178,7 @@ touch x = IO $ \s-> case touch# x s of s' -> (# s', () #) hashByteArray arr = H.hashByteArray (unArray arr) 0 (length arr)+{-# INLINE hashByteArray #-} #define deriveElt(Typ, Ct, rd, wrt, ix, sz) \ instance Elt Typ where { \@@ -226,7 +228,7 @@ lengthM (MutableByteArray _ n) = n hashByteArray arr =- unsafePerformIO $+ inlinePerformIO $ withArrayPtr arr $ \ptr -> H.hashPtr ptr (length arr) @@ -236,7 +238,7 @@ = unsafeIOToST $ withMArrayPtr ary $ \ptr -> peekElemOff ptr ndx \ ; write ary ndx word \ = unsafeIOToST $ withMArrayPtr ary $ \ptr -> pokeElemOff ptr ndx word \-; index ary ndx = unsafePerformIO $ withArrayPtr ary $ \ptr -> peekElemOff ptr ndx \+; index ary ndx = inlinePerformIO $ withArrayPtr ary $ \ptr -> peekElemOff ptr ndx \ ; elemSize = sizeOf \ }
Data/SmallArray/Internal.hs view
@@ -63,6 +63,7 @@ instance H.Hashable (Array a) where hash (A bArr) = B.hashByteArray bArr+ {-# INLINE hash #-} eqArray :: (Eq a, Elt a) => Array a -> Array a -> Bool eqArray a b
smallarray.cabal view
@@ -3,7 +3,7 @@ -- See the Haskell package versioning policy -- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for -- standards guiding when and how versions should be incremented.-Version: 0.2.1+Version: 0.2.2 Synopsis: low-level unboxed arrays, with minimal features. @@ -43,5 +43,8 @@ Other-modules: Data.ByteArray Data.SmallArray.Internal - Build-depends: base < 4.4, deepseq >= 1.1 && < 1.2, hashable < 1.1 && >= 1.0.1+ Build-depends: base < 4.4, deepseq >= 1.1 && < 1.2, hashable < 1.2 && >= 1.0.1,+ bytestring >=0.9 && <0.10 ghc-options: -Wall -funbox-strict-fields -O2++ -- cpp-options: -DTESTING_FFI