ram 0.19.0 → 0.20.0
raw patch · 8 files changed
+13/−47 lines, 8 files
Files
- CHANGELOG.md +4/−0
- Data/ByteArray/Bytes.hs +5/−15
- Data/ByteArray/ScrubbedBytes.hs +1/−0
- Data/ByteArray/Sized.hs +1/−1
- Data/Memory/Hash/FNV.hs +1/−0
- Data/Memory/Internal/DeepSeq.hs +0/−28
- Data/Memory/Internal/Imports.hs +0/−1
- ram.cabal +1/−2
CHANGELOG.md view
@@ -1,3 +1,7 @@+## 0.20++ Drop Data.Internal.Memory.Deepseq module to prevent confusion.+ we can just use the one from deepseq.+ ## 0.19 + Forked from memory + Dropped all dependencies for basement and the like
Data/ByteArray/Bytes.hs view
@@ -7,7 +7,6 @@ -- -- Simple and efficient byte array types ---{-# LANGUAGE CPP #-} {-# LANGUAGE BangPatterns #-} {-# LANGUAGE MagicHash #-} {-# LANGUAGE UnboxedTuples #-}@@ -16,20 +15,15 @@ ( Bytes ) where -#if MIN_VERSION_base(4,15,0)+import Control.DeepSeq(NFData(..)) import GHC.Exts (unsafeCoerce#)-#endif import GHC.Word import GHC.Char (chr) import GHC.Types import GHC.Prim import GHC.Ptr-#if MIN_VERSION_base(4,9,0) import Data.Semigroup import Data.Foldable (toList)-#else-import Data.Monoid-#endif import Data.Memory.PtrMethods import Data.Memory.Internal.Imports import Data.Memory.Internal.CompatPrim@@ -42,25 +36,21 @@ data Bytes = Bytes (MutableByteArray# RealWorld) deriving (Typeable) +instance NFData Bytes where+ rnf b = b `seq` ()+ instance Show Bytes where showsPrec p b r = showsPrec p (bytesUnpackChars b []) r instance Eq Bytes where (==) = bytesEq instance Ord Bytes where compare = bytesCompare-#if MIN_VERSION_base(4,9,0) instance Semigroup Bytes where b1 <> b2 = unsafeDoIO $ bytesAppend b1 b2 sconcat = unsafeDoIO . bytesConcat . toList-#endif instance Monoid Bytes where mempty = unsafeDoIO (newBytes 0)-#if !(MIN_VERSION_base(4,11,0))- mappend b1 b2 = unsafeDoIO $ bytesAppend b1 b2- mconcat = unsafeDoIO . bytesConcat-#endif-instance NFData Bytes where- rnf b = b `seq` ()+ instance ByteArrayAccess Bytes where length = bytesLength withByteArray = withBytes
Data/ByteArray/ScrubbedBytes.hs view
@@ -14,6 +14,7 @@ ( ScrubbedBytes ) where +import Control.DeepSeq(NFData(..)) import GHC.Types import GHC.Prim import GHC.Ptr
Data/ByteArray/Sized.hs view
@@ -61,7 +61,7 @@ import Data.Proxy (Proxy(..)) import Data.Maybe (fromMaybe) import GHC.TypeLits (KnownNat, Nat, natVal, type (+), type (<=))-import Data.Memory.Internal.DeepSeq (NFData)+import Control.DeepSeq(NFData(..)) import Foreign.Storable import Foreign.Ptr
Data/Memory/Hash/FNV.hs view
@@ -31,6 +31,7 @@ import GHC.Prim hiding (Word64#, Int64#) import GHC.Types import GHC.Ptr+import Control.DeepSeq(NFData(..)) -- | FNV1(a) hash (32 bit variants) newtype FnvHash32 = FnvHash32 Word32
− Data/Memory/Internal/DeepSeq.hs
@@ -1,28 +0,0 @@--- |--- Module : Data.Memory.Internal.DeepSeq--- License : BSD-style--- Maintainer : Vincent Hanquez <vincent@snarc.org>--- Stability : experimental--- Portability : unknown------ Simple abstraction module to allow compilation without deepseq--- by defining our own NFData class if not compiling with deepseq--- support.----{-# LANGUAGE CPP #-}-module Data.Memory.Internal.DeepSeq- ( NFData(..)- ) where--#ifdef WITH_DEEPSEQ_SUPPORT-import Control.DeepSeq-#else-import Data.Word--class NFData a where rnf :: a -> ()--instance NFData Word8 where rnf w = w `seq` ()-instance NFData Word16 where rnf w = w `seq` ()-instance NFData Word32 where rnf w = w `seq` ()-instance NFData Word64 where rnf w = w `seq` ()-#endif
Data/Memory/Internal/Imports.hs view
@@ -14,4 +14,3 @@ import Control.Applicative as X import Control.Monad as X (forM, forM_, void, when) import Control.Arrow as X (first, second)-import Data.Memory.Internal.DeepSeq as X
ram.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: ram-version: 0.19.0+version: 0.20.0 synopsis: memory and related abstraction stuff description: This is a fork of memory. It's open to accept changes from anyone,@@ -66,7 +66,6 @@ Data.Memory.Internal.Compat Data.Memory.Internal.CompatPrim Data.Memory.Internal.CompatPrim64- Data.Memory.Internal.DeepSeq Data.Memory.Internal.Imports exposed-modules: Data.ByteArray.Sized