fast-builder 0.1.1.0 → 0.1.2.0
raw patch · 3 files changed
+11/−5 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Data/ByteString/FastBuilder/Internal.hs +2/−0
- fast-builder.cabal +1/−1
- tests/prop.hs +8/−4
Data/ByteString/FastBuilder/Internal.hs view
@@ -615,6 +615,8 @@ cur <- getCur io $ flushQueue h queueRef cur io $ S.hPut h bstr+ io $ modifyIORef' queueRef+ $ \q -> q { queueTotal = queueTotal q + S.length bstr } {-# NOINLINE byteStringInsert_ #-} -- | Turn a C String into a 'Builder'. The behavior is undefined if the given
fast-builder.cabal view
@@ -1,5 +1,5 @@ name: fast-builder-version: 0.1.1.0+version: 0.1.2.0 synopsis: Fast ByteString Builder description: An efficient implementation of ByteString builder. It should be faster than the standard implementation in most cases.
tests/prop.hs view
@@ -29,7 +29,8 @@ data BuilderPrim = BP_Word8 !Word8 | BP_Word64le !Word64- | BP_ByteString !BS.ByteString+ | BP_ByteStringC !BS.ByteString+ | BP_ByteStringI !BS.ByteString | BP_Empty deriving (Show) @@ -46,7 +47,8 @@ arbitrary = QC.oneof [ BP_Word8 <$> QC.arbitrary , BP_Word64le <$> QC.arbitrary- , BP_ByteString . BS.pack <$> QC.arbitrary+ , BP_ByteStringC . BS.pack <$> QC.arbitrary+ , BP_ByteStringI . BS.pack <$> QC.arbitrary , pure BP_Empty ] @@ -84,7 +86,8 @@ prim (BP_Word8 w) = word8 w prim (BP_Word64le w) = word64LE w- prim (BP_ByteString bs) = byteString bs+ prim (BP_ByteStringI bs) = byteStringInsert bs+ prim (BP_ByteStringC bs) = byteStringCopy bs prim BP_Empty = mempty buildWithBuilder :: Driver -> BuilderTree -> BS.ByteString@@ -100,7 +103,8 @@ prim (BP_Word64le w) = (list++) where list = take 8 $ map fromIntegral $ iterate (`div` 256) w- prim (BP_ByteString bs) = (BS.unpack bs ++)+ prim (BP_ByteStringI bs) = (BS.unpack bs ++)+ prim (BP_ByteStringC bs) = (BS.unpack bs ++) prim BP_Empty = id errorBuilder :: TestException -> Builder