Z-IO-0.1.5.0: Simple and high performance IO toolkit for Haskell

Copyright(c) Dong Han 2017-2018
LicenseBSD
Maintainerwinterland1989@gmail.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Z.Compression.Zlib

Contents

Description

This module provides zlib bindings.

Synopsis

Compression

compress :: HasCallStack => CompressConfig -> Bytes -> Bytes Source #

Compress some bytes.

compressSink :: HasCallStack => CompressConfig -> Sink Bytes -> IO (Sink Bytes) Source #

Compress all the data written to a output.

data Strategy where Source #

Bundled Patterns

pattern Z_FILTERED :: Strategy 
pattern Z_HUFFMAN_ONLY :: Strategy 
pattern Z_RLE :: Strategy 
pattern Z_FIXED :: Strategy 
pattern Z_DEFAULT_STRATEGY :: Strategy 
Instances
Eq Strategy Source # 
Instance details

Defined in Z.Compression.Zlib

Ord Strategy Source # 
Instance details

Defined in Z.Compression.Zlib

Show Strategy Source # 
Instance details

Defined in Z.Compression.Zlib

Generic Strategy Source # 
Instance details

Defined in Z.Compression.Zlib

Associated Types

type Rep Strategy :: Type -> Type #

Methods

from :: Strategy -> Rep Strategy x #

to :: Rep Strategy x -> Strategy #

ShowT Strategy Source # 
Instance details

Defined in Z.Compression.Zlib

type Rep Strategy Source # 
Instance details

Defined in Z.Compression.Zlib

type Rep Strategy = D1 (MetaData "Strategy" "Z.Compression.Zlib" "Z-IO-0.1.5.0-8sLj6ZMbh2s3VZm7kS3Now" True) (C1 (MetaCons "Strategy" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 CInt)))

data CompressLevel where Source #

Instances
Eq CompressLevel Source # 
Instance details

Defined in Z.Compression.Zlib

Ord CompressLevel Source # 
Instance details

Defined in Z.Compression.Zlib

Show CompressLevel Source # 
Instance details

Defined in Z.Compression.Zlib

Generic CompressLevel Source # 
Instance details

Defined in Z.Compression.Zlib

Associated Types

type Rep CompressLevel :: Type -> Type #

ShowT CompressLevel Source # 
Instance details

Defined in Z.Compression.Zlib

type Rep CompressLevel Source # 
Instance details

Defined in Z.Compression.Zlib

type Rep CompressLevel = D1 (MetaData "CompressLevel" "Z.Compression.Zlib" "Z-IO-0.1.5.0-8sLj6ZMbh2s3VZm7kS3Now" True) (C1 (MetaCons "CompressLevel" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 CInt)))

data WindowBits Source #

The WindowBits is the base two logarithm of the maximum window size (the size of the history buffer). It should be in the range 8..15 for this version of the library. The defaultWindowBits value is 15. Decompressing windowBits must be greater than or equal to the compressing windowBits. If a compressed stream with a larger window size is given as input, decompress will throw ZDataError windowBits can also be –8..–15 for raw inflate. In this case, -windowBits determines the window size. inflate() will then process raw deflate data, not looking for a zlib or gzip header, not generating a check value, and not looking for any check values for comparison at the end of the stream. windowBits can also be greater than 15 for optional gzip decoding. Add 32 to windowBits to enable zlib and gzip decoding with automatic header detection, or add 16 to decode only the gzip format.

Instances
Eq WindowBits Source # 
Instance details

Defined in Z.Compression.Zlib

Num WindowBits Source # 
Instance details

Defined in Z.Compression.Zlib

Ord WindowBits Source # 
Instance details

Defined in Z.Compression.Zlib

Read WindowBits Source # 
Instance details

Defined in Z.Compression.Zlib

Show WindowBits Source # 
Instance details

Defined in Z.Compression.Zlib

Generic WindowBits Source # 
Instance details

Defined in Z.Compression.Zlib

Associated Types

type Rep WindowBits :: Type -> Type #

ShowT WindowBits Source # 
Instance details

Defined in Z.Compression.Zlib

type Rep WindowBits Source # 
Instance details

Defined in Z.Compression.Zlib

type Rep WindowBits = D1 (MetaData "WindowBits" "Z.Compression.Zlib" "Z-IO-0.1.5.0-8sLj6ZMbh2s3VZm7kS3Now" True) (C1 (MetaCons "WindowBits" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 CInt)))

data MemLevel Source #

The MemLevel specifies how much memory should be allocated for the internal compression state. 1 uses minimum memory but is slow and reduces compression ratio; 9 uses maximum memory for optimal speed. The default value is 8.

Instances
Eq MemLevel Source # 
Instance details

Defined in Z.Compression.Zlib

Num MemLevel Source # 
Instance details

Defined in Z.Compression.Zlib

Ord MemLevel Source # 
Instance details

Defined in Z.Compression.Zlib

Read MemLevel Source # 
Instance details

Defined in Z.Compression.Zlib

Show MemLevel Source # 
Instance details

Defined in Z.Compression.Zlib

Generic MemLevel Source # 
Instance details

Defined in Z.Compression.Zlib

Associated Types

type Rep MemLevel :: Type -> Type #

Methods

from :: MemLevel -> Rep MemLevel x #

to :: Rep MemLevel x -> MemLevel #

ShowT MemLevel Source # 
Instance details

Defined in Z.Compression.Zlib

type Rep MemLevel Source # 
Instance details

Defined in Z.Compression.Zlib

type Rep MemLevel = D1 (MetaData "MemLevel" "Z.Compression.Zlib" "Z-IO-0.1.5.0-8sLj6ZMbh2s3VZm7kS3Now" True) (C1 (MetaCons "MemLevel" PrefixI False) (S1 (MetaSel (Nothing :: Maybe Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 CInt)))

Decompression

decompress :: HasCallStack => DecompressConfig -> Bytes -> Bytes Source #

Decompress some bytes.

decompressSource :: DecompressConfig -> Source Bytes -> IO (Source Bytes) Source #

Decompress bytes from source.