packages feed

pipes-zlib 0.4.2.1 → 0.4.3

raw patch · 4 files changed

+43/−9 lines, 4 files

Files

changelog.md view
@@ -1,3 +1,8 @@+# Version 0.4.3++* Fix usage of the `Producer'` type synonym (#14).++ # Version 0.4.2.1  * Fix “Codec.Compression.Zlib: premature end of compressed stream” (#13)
pipes-zlib.cabal view
@@ -1,5 +1,5 @@ name:               pipes-zlib-version:            0.4.2.1+version:            0.4.3 license:            BSD3 license-file:       LICENSE Copyright:          Copyright (c) Paolo Capriotti 2012,
src/Pipes/GZip.hs view
@@ -25,19 +25,33 @@ --------------------------------------------------------------------------------  -- | Decompress bytes flowing from a 'Producer'.+--+-- @+-- 'decompress' :: 'MonadIO' m+--            => 'Producer' 'B.ByteString' m r+--            -> 'Producer' 'B.ByteString' m r+-- @ decompress   :: MonadIO m-  => Producer' B.ByteString m r -- ^ Compressed stream-  -> Producer' B.ByteString m r -- ^ Decompressed stream+  => Proxy x' x () B.ByteString m r -- ^ Compressed stream+  -> Proxy x' x () B.ByteString m r -- ^ Decompressed stream+  -- -> Producer' B.ByteString m r -- ^ Decompressed stream decompress = Pipes.Zlib.decompress (ZC.WindowBits 31) {-# INLINABLE decompress #-}   -- | Compress bytes flowing from a 'Producer'.+--+-- @+-- 'compress' :: 'MonadIO' m+--          => 'ZC.CompressionLevel'+--          -> 'Producer' 'B.ByteString' m r+--          -> 'Producer' 'B.ByteString' m r+-- @ compress   :: MonadIO m   => ZC.CompressionLevel-  -> Producer' B.ByteString m r -- ^ Decompressed stream-  -> Producer' B.ByteString m r -- ^ Compressed stream+  -> Proxy x' x () B.ByteString m r -- ^ Decompressed stream+  -> Proxy x' x () B.ByteString m r -- ^ Compressed stream compress clevel = Pipes.Zlib.compress clevel (ZC.WindowBits 31) {-# INLINABLE compress #-}
src/Pipes/Zlib.hs view
@@ -36,11 +36,18 @@ -- | Decompress bytes flowing from a 'Producer'. -- -- See the "Codec.Compression.Zlib" module for details about 'Z.WindowBits'.+--+-- @+-- 'decompress' :: 'MonadIO' m+--            => 'ZC.WindowBits'+--            => 'Producer' 'B.ByteString' m r+--            -> 'Producer' 'B.ByteString' m r+-- @ decompress   :: MonadIO m   => ZC.WindowBits-  -> Producer' B.ByteString m r -- ^ Compressed stream-  -> Producer' B.ByteString m r -- ^ Decompressed stream+  -> Proxy x' x () B.ByteString m r -- ^ Compressed stream+  -> Proxy x' x () B.ByteString m r -- ^ Decompressed stream decompress wbits p0 = do     inf <- liftIO $ Z.initInflate wbits     r <- for p0 $ \bs -> do@@ -56,12 +63,20 @@ -- -- See the "Codec.Compression.Zlib" module for details about -- 'ZC.CompressionLevel' and 'ZC.WindowBits'.+--+-- @+-- 'compress' :: 'MonadIO' m+--          => 'ZC.CompressionLevel'+--          -> 'ZC.WindowBits'+--          -> 'Producer' 'B.ByteString' m r+--          -> 'Producer' 'B.ByteString' m r+-- @ compress   :: MonadIO m   => ZC.CompressionLevel   -> ZC.WindowBits-  -> Producer' B.ByteString m r -- ^ Decompressed stream-  -> Producer' B.ByteString m r -- ^ Compressed stream+  -> Proxy x' x () B.ByteString m r -- ^ Decompressed stream+  -> Proxy x' x () B.ByteString m r -- ^ Compressed stream compress clevel wbits p0 = do     def <- liftIO $ Z.initDeflate (fromCompressionLevel clevel) wbits     r <- for p0 $ \bs -> do