pipes-zlib-0.4.4.1: Zlib and GZip compression and decompression for Pipes streams

Safe Haskell | None
Language | Haskell2010

Pipes.Zlib

Contents

- Streams
- Compression levels
- Window size

Description

This module exports utilities to compress and decompress `pipes` streams using the zlib compression codec.

If you want to compress or decompress GZip streams, use the Pipes.GZip module instead.

Synopsis

- decompress :: MonadIO m => WindowBits -> Proxy x' x () ByteString m r -> Proxy x' x () ByteString m r
- decompress' :: MonadIO m => WindowBits -> Producer ByteString m r -> Producer ByteString m (Either (Producer ByteString m r) r)
- compress :: MonadIO m => CompressionLevel -> WindowBits -> Proxy x' x () ByteString m r -> Proxy x' x () ByteString m r
- data CompressionLevel
- defaultCompression :: CompressionLevel
- noCompression :: CompressionLevel
- bestSpeed :: CompressionLevel
- bestCompression :: CompressionLevel
- compressionLevel :: Int -> CompressionLevel
- defaultWindowBits :: WindowBits
- windowBits :: Int -> WindowBits

# Streams

decompress Source #

Arguments

:: MonadIO m |
=> WindowBits |
-> Proxy x' x () ByteString m r | Compressed stream
-> Proxy x' x () ByteString m r | Decompressed stream

Decompress bytes flowing from a `Producer`.

See the Codec.Compression.Zlib module for details about `WindowBits`.

    decompress :: MonadIO m
               => WindowBits
               => Producer ByteString m r
               -> Producer ByteString m r

decompress' Source #

Arguments

:: MonadIO m |
=> WindowBits |
-> Producer ByteString m r | Compressed stream
-> Producer ByteString m (Either (Producer ByteString m r) r) | Decompressed stream, ending with either leftovers or a result

Decompress bytes flowing from a `Producer`, returning any leftover input that follows the compressed stream.

compress Source #

Arguments

:: MonadIO m |
=> CompressionLevel |
-> WindowBits |
-> Proxy x' x () ByteString m r | Decompressed stream
-> Proxy x' x () ByteString m r | Compressed stream

Compress bytes flowing from a `Producer`.

See the Codec.Compression.Zlib module for details about `CompressionLevel` and `WindowBits`.

    compress :: MonadIO m
             => CompressionLevel
             -> WindowBits
             -> Producer ByteString m r
             -> Producer ByteString m r

# Compression levels

data CompressionLevel Source #

How hard should we try to compress?

Instances

Eq CompressionLevel Source # |
Methods (==) :: CompressionLevel -> CompressionLevel -> Bool # (/=) :: CompressionLevel -> CompressionLevel -> Bool #
Ord CompressionLevel Source # |

Methods

compare :: CompressionLevel -> CompressionLevel -> Ordering #

(<) :: CompressionLevel -> CompressionLevel -> Bool #

(<=) :: CompressionLevel -> CompressionLevel -> Bool #

(>) :: CompressionLevel -> CompressionLevel -> Bool #

(>=) :: CompressionLevel -> CompressionLevel -> Bool #

max :: CompressionLevel -> CompressionLevel -> CompressionLevel #

min :: CompressionLevel -> CompressionLevel -> CompressionLevel #

Read CompressionLevel Source # |
Methods readsPrec :: Int -> ReadS CompressionLevel # readList :: ReadS [CompressionLevel] # readPrec :: ReadPrec CompressionLevel # readListPrec :: ReadPrec [CompressionLevel] #
Show CompressionLevel Source # |
Methods showsPrec :: Int -> CompressionLevel -> ShowS # show :: CompressionLevel -> String # showList :: [CompressionLevel] -> ShowS #

defaultCompression :: CompressionLevel Source #

noCompression :: CompressionLevel Source #

bestSpeed :: CompressionLevel Source #

bestCompression :: CompressionLevel Source #

compressionLevel :: Int -> CompressionLevel Source #

A specific compression level between 0 and 9.

# Window size

The following are re-exported from Codec.Compression.Zlib for your convenience.

defaultWindowBits :: WindowBits #

windowBits :: Int -> WindowBits Source #