bytestring-builder 0.10.8.1.0 → 0.10.8.2.0
raw patch · 5 files changed
+22/−14 lines, 5 filesnew-uploader
Files
- CHANGELOG.md +2/−0
- bytestring-builder.cabal +3/−1
- src/Data/ByteString/Builder/Internal.hs +7/−3
- src/Data/ByteString/Builder/Prim.hs +4/−0
- src/Data/ByteString/Short/Internal.hs +6/−10
+ CHANGELOG.md view
@@ -0,0 +1,2 @@+## 0.10.8.2.0 [2018.09.25]+* Synchronize with `bytestring-0.10.8.2`.
bytestring-builder.cabal view
@@ -1,5 +1,5 @@ name: bytestring-builder-version: 0.10.8.1.0+version: 0.10.8.2.0 synopsis: The new bytestring builder, packaged outside of GHC description: This is the bytestring builder that is debuting in bytestring-0.10.4.0, which@@ -42,6 +42,8 @@ src/Data/ByteString/Builder/Prim/*.hs src/Data/ByteString/Builder/Prim/Internal/*.hs src/Data/ByteString/Short/*.hs++ CHANGELOG.md cabal-version: >=1.8 source-repository head
src/Data/ByteString/Builder/Internal.hs view
@@ -1,4 +1,8 @@ {-# LANGUAGE ScopedTypeVariables, CPP, BangPatterns, RankNTypes #-}+#if __GLASGOW_HASKELL__ == 700+-- This is needed as a workaround for an old bug in GHC 7.0.1 (Trac #4498)+{-# LANGUAGE MonoPatBinds #-}+#endif #if __GLASGOW_HASKELL__ >= 703 {-# LANGUAGE Unsafe #-} #endif@@ -92,7 +96,7 @@ , lazyByteStringCopy , lazyByteStringInsert , lazyByteStringThreshold- + , shortByteString , maximalCopySize@@ -201,8 +205,8 @@ byteStringFromBuffer (Buffer fpbuf (BufferRange op _)) = S.PS fpbuf 0 (op `minusPtr` unsafeForeignPtrToPtr fpbuf) ---- | Prepend the filled part of a 'Buffer' to a lazy 'L.ByteString'---- trimming it if necessary.+-- | Prepend the filled part of a 'Buffer' to a lazy 'L.ByteString'+-- trimming it if necessary. {-# INLINE trimmedChunkFromBuffer #-} trimmedChunkFromBuffer :: AllocationStrategy -> Buffer -> L.ByteString -> L.ByteString
src/Data/ByteString/Builder/Prim.hs view
@@ -1,5 +1,9 @@ {-# LANGUAGE CPP, BangPatterns, ScopedTypeVariables #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-}+#if __GLASGOW_HASKELL__ == 700+-- This is needed as a workaround for an old bug in GHC 7.0.1 (Trac #4498)+{-# LANGUAGE MonoPatBinds #-}+#endif #if __GLASGOW_HASKELL__ >= 701 {-# LANGUAGE Trustworthy #-} #endif
src/Data/ByteString/Short/Internal.hs view
@@ -149,7 +149,7 @@ mconcat = concat instance NFData ShortByteString where- rnf (SBS {}) = ()+ rnf SBS{} = () instance Show ShortByteString where showsPrec p ps r = showsPrec p (unpackChars ps) r@@ -161,7 +161,7 @@ fromString = packChars instance Data ShortByteString where- gfoldl f z txt = z packBytes `f` (unpackBytes txt)+ gfoldl f z txt = z packBytes `f` unpackBytes txt toConstr _ = error "Data.ByteString.Short.ShortByteString.toConstr" gunfold _ _ = error "Data.ByteString.Short.ShortByteString.gunfold" dataTypeOf _ = mkNoRepType "Data.ByteString.Short.ShortByteString"@@ -320,8 +320,7 @@ -- (5 words per list element, 8 bytes per word, 100 elements = 4000 bytes) unpackAppendCharsLazy :: ShortByteString -> [Char] -> [Char]-unpackAppendCharsLazy sbs cs0 =- go 0 (length sbs) cs0+unpackAppendCharsLazy sbs cs0 = go 0 (length sbs) cs0 where sz = 100 @@ -331,8 +330,7 @@ where remainder = go (off+sz) (len-sz) cs unpackAppendBytesLazy :: ShortByteString -> [Word8] -> [Word8]-unpackAppendBytesLazy sbs ws0 =- go 0 (length sbs) ws0+unpackAppendBytesLazy sbs ws0 = go 0 (length sbs) ws0 where sz = 100 @@ -347,8 +345,7 @@ -- buffer and loops down until we hit the sentinal: unpackAppendCharsStrict :: ShortByteString -> Int -> Int -> [Char] -> [Char]-unpackAppendCharsStrict !sbs off len cs =- go (off-1) (off-1 + len) cs+unpackAppendCharsStrict !sbs off len cs = go (off-1) (off-1 + len) cs where go !sentinal !i !acc | i == sentinal = acc@@ -356,8 +353,7 @@ in go sentinal (i-1) (c:acc) unpackAppendBytesStrict :: ShortByteString -> Int -> Int -> [Word8] -> [Word8]-unpackAppendBytesStrict !sbs off len ws =- go (off-1) (off-1 + len) ws+unpackAppendBytesStrict !sbs off len ws = go (off-1) (off-1 + len) ws where go !sentinal !i !acc | i == sentinal = acc