blaze-builder-enumerator-0.2.1.0: Enumeratees for the incremental conversion of builders to bytestrings.

PortabilityTested on GHC only
StabilityExperimental
MaintainerSimon Meier <iridcode@gmail.com>
Safe HaskellNone

Blaze.ByteString.Builder.Enumerator

Contents

Description

Infrastructure and enumeratees for the incremental execution of builders and passing on of the filled chunks as bytestrings to an inner iteratee.

Note that the Buffer code is likely to move/change in order to reconciliate it with the rest of the blaze-builder library.

Synopsis

Buffers

data Buffer

Status information

Creation and modification

Conversion to bytestings

Buffer allocation strategies

Enumeratees from builders to bytestrings

builderToByteString :: MonadIO m => Enumeratee Builder ByteString m aSource

Incrementally execute builders and pass on the filled chunks as bytestrings.

unsafeBuilderToByteString :: MonadIO m => IO Buffer -> Enumeratee Builder ByteString m aSource

Incrementally execute builders on the given buffer and pass on the filled chunks as bytestrings. Note that, if the given buffer is too small for the execution of a build step, a larger one will be allocated.

WARNING: This enumeratee yields bytestrings that are NOT referentially transparent. Their content will be overwritten as soon as control is returned from the inner iteratee!

builderToByteStringWith :: MonadIO m => BufferAllocStrategy -> Enumeratee Builder ByteString m aSource

An enumeratee that incrementally executes builders and passes on the filled chunks as bytestrings to an inner iteratee.

INV: All bytestrings passed to the inner iteratee are non-empty.