[commit: packages/bytestring] master: Add support for `deepseq-1.4.0.0` (30e135c)
git at git.haskell.org
git at git.haskell.org
Fri Jan 23 22:43:19 UTC 2015
Repository : ssh://git@git.haskell.org/bytestring
On branch : master
Link : http://git.haskell.org/packages/bytestring.git/commitdiff/30e135c18f44567797b3a34af6d49ddd52cc6ea1
>---------------------------------------------------------------
commit 30e135c18f44567797b3a34af6d49ddd52cc6ea1
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date: Fri Nov 14 17:33:35 2014 +0100
Add support for `deepseq-1.4.0.0`
This change avoids relying on `rnf`'s default method implementation
which has changed in `deepseq-1.4.0.0`
NB: previously uploaded `bytestring` releases on Hackage need retroactive
upper bounds on `deepseq`
>---------------------------------------------------------------
30e135c18f44567797b3a34af6d49ddd52cc6ea1
Data/ByteString/Internal.hs | 5 +++--
Data/ByteString/Short/Internal.hs | 3 ++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/Data/ByteString/Internal.hs b/Data/ByteString/Internal.hs
index 15192c1..703c136 100644
--- a/Data/ByteString/Internal.hs
+++ b/Data/ByteString/Internal.hs
@@ -94,7 +94,7 @@ import Foreign.C.Types (CInt, CSize, CULong)
import Foreign.C.String (CString)
import Data.Monoid (Monoid(..))
-import Control.DeepSeq (NFData)
+import Control.DeepSeq (NFData(rnf))
#if MIN_VERSION_base(3,0,0)
import Data.String (IsString(..))
@@ -212,7 +212,8 @@ instance Monoid ByteString where
mappend = append
mconcat = concat
-instance NFData ByteString
+instance NFData ByteString where
+ rnf (PS _ _ _) = ()
instance Show ByteString where
showsPrec p ps r = showsPrec p (unpackChars ps) r
diff --git a/Data/ByteString/Short/Internal.hs b/Data/ByteString/Short/Internal.hs
index 9624de2..01630ef 100644
--- a/Data/ByteString/Short/Internal.hs
+++ b/Data/ByteString/Short/Internal.hs
@@ -136,7 +136,8 @@ instance Monoid ShortByteString where
mappend = append
mconcat = concat
-instance NFData ShortByteString
+instance NFData ShortByteString where
+ rnf (SBS !_) = ()
instance Show ShortByteString where
showsPrec p ps r = showsPrec p (unpackChars ps) r
More information about the ghc-commits
mailing list