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

Copyright(c) 2010 Simon Meier
LicenseBSD3
MaintainerSimon Meier <iridcode@gmail.com>
StabilityExperimental
PortabilityTested on GHC only
Safe HaskellNone
LanguageHaskell98

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 a #

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

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

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 a #

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.