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

Safe Haskell | None
Language | Haskell2010

Pipes.GZip

Contents

- Streams
- Compression level

Description

This module exports utilities to compress and decompress GZip `pipes` streams.

Synopsis

- decompress :: MonadIO m => Proxy x' x () ByteString m r -> Proxy x' x () ByteString m r
- decompress' :: MonadIO m => Producer ByteString m r -> Producer ByteString m (Either (Producer ByteString m r) r)
- compress :: MonadIO m => CompressionLevel -> 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

# Streams

decompress Source #

Arguments

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

Decompress bytes flowing from a `Producer`.

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

decompress' Source #

Arguments

:: MonadIO m |
=> Producer ByteString m r | Compressed stream
-> Producer ByteString m (Either (Producer ByteString m r) r) | Decompressed stream, returning either a `Producer` of the leftover input or the return value from the input `Producer`.

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

compress Source #

Arguments

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

Compress bytes flowing from a `Producer`.

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

# Compression level

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.