HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleconduit-extra-1.3.8Haskell2010

Data.Conduit.Zlib

Streaming compression and decompression using conduits.

Parts of this code were taken from zlib-enum and adapted for conduits.

  • 1 type
  • 8 values

Conduits

4 declarations

Flushing

2 declarations

Decompression combinators

1 declaration
valuemultiple
  1. :: Monad m
  2. => ConduitT ByteString a m ()
  3. -> ConduitT ByteString a m ()
#

The standard decompress and ungzip functions will only decompress a single compressed entity from the stream. This combinator will exhaust the stream completely of all individual compressed entities. This is useful for cases where you have a concatenated archive, e.g. cat file1.gz file2.gz > combined.gz.

Usage:

sourceFile "combined.gz" $$ multiple ungzip =$ consume

This combinator will not fail on an empty stream. If you want to ensure that at least one compressed entity in the stream exists, consider a usage such as:

sourceFile "combined.gz" $$ (ungzip >> multiple ungzip) =$ consume

Re-exported from zlib-bindings

2 declarations
newtypenewtype WindowBits
#

This specifies the size of the compression window. Larger values of this parameter result in better compression at the expense of higher memory usage.

The compression window size is the value of the the window bits raised to the power 2. The window bits must be in the range 9..15 which corresponds to compression window sizes of 512b to 32Kb. The default is 15 which is also the maximum size.

The total amount of memory used depends on the window bits and the MemoryLevel. See the MemoryLevel for the details.

Constructors

Instances5Eq, Ord, Show, Generic, Rep