lens-4.1.2.1: Lenses, Folds and Traversals

Copyright(C) 2012-14 Edward Kmett
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityprovisional
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Codec.Compression.Zlib.Lens

Contents

Description

lens support for the zlib library

Synopsis

High-Level API

zlibbed :: Iso' ByteString ByteString Source

Compresses a ByteString using the zlib compression format.

zlibbed = compressed zlib
zlibbed = 'zlibbed\'' defaultParams

compressed :: Format -> Iso' ByteString ByteString Source

Compresses a ByteString using the given compression format.

compressed fmt = compressed' fmt defaultParams

data Format :: *

Instances

gzip :: Format Source

The gzip compression format.

zlib :: Format Source

The zlib compression format.

deflate :: Format Source

The deflate compression format.

Low-Level API

zlibbed' :: Params -> Iso' ByteString ByteString Source

Compresses a ByteString using the zlib compression format and the given advanced parameters.

zlibbed = compressed zlib
zlibbed = zlibbed' defaultParams

gzipped' :: Params -> Iso' ByteString ByteString Source

Compresses a ByteString using the gzip compression format and the given advanced parameters.

gzipped = compressed gzip
gzipped = gzipped' defaultParams

deflated' :: Params -> Iso' ByteString ByteString Source

Compresses a ByteString using the deflate compression format and the given advanced parameters.

deflated = compressed deflate
deflated = deflated' defaultParams

compressed' :: Format -> Params -> Iso' ByteString ByteString Source

Compresses a ByteString using the given compression format and the given advanced parameters.

data Params Source

The advanced parameters needed by gzipped', zlibbed', deflated', and compressed'.

Use defaultParams and the provided Lenses to construct custom Params.

defaultParams :: Params Source

The default advanced parameters for compression and decompression.

levelC :: Lens' Params CompressionLevel Source

The compression level.

methodC :: Lens' Params Method Source

The compression method.

windowBitsC :: Lens' Params WindowBits Source

The number of bits in the compression window.

windowBitsD :: Lens' Params WindowBits Source

The number of bits in the decompression window.

memoryLevelC :: Lens' Params MemoryLevel Source

The amount of memory allowed for the internal compression state.

strategyC :: Lens' Params CompressionStrategy Source

The compression strategy.

bufferSizeC :: Lens' Params Int Source

The initial buffer size during compression.

bufferSizeD :: Lens' Params Int Source

The initial buffer size during decompression.

dictionary :: Lens' Params (Maybe ByteString) Source

Just the custom (de)compression dictionary to use, or Nothing to not use a custom dictionary.

data Method :: *

data WindowBits :: *

data MemoryLevel :: *