Builder -is:module
Builders denote sequences of bytes. They are
Monoids
where
mempty is the zero-length sequence and
mappend is
concatenation, which runs in
O(1).
A Builder is an efficient way to build lazy Text
values. There are several functions for constructing builders, but
only one to inspect them: to extract any data, you have to turn them
into lazy Text values using toLazyText.
Internally, a builder constructs a lazy Text by filling
arrays piece by piece. As each buffer is filled, it is 'popped' off,
to become a new chunk of the resulting lazy Text. All this is
hidden from the user of the Builder.
A builder for building the CSV data incrementally. Just like the
ByteString builder, this builder should be used in a
right-associative,
foldr style. Using
<> to
compose builders in a left-associative,
foldl' style makes
the building not be incremental.
Builders denote sequences of bytes. They are
Monoids
where
mempty is the zero-length sequence and
mappend is
concatenation, which runs in
O(1).
An unmaterialized sequence of bytes that may be pasted into a mutable
byte array.
A builder parameterized by the maximum number of bytes it uses when
executed.
A builder parameterized by the maximum number of bytes it uses when
executed.
An unmaterialized sequence of bytes that may be pasted into a mutable
byte array.
Memory-managed wrapper type.
A simple stateful function composing monad that chains state passing
functions. This can be considered as a simplified version of the State
monad or even a Fold. Unlike fold the step function is one-shot and
not called in a loop.
Thin wrapper over
Buffer with a handy
Semigroup
instance.
>>> :set -XOverloadedStrings -XMagicHash
>>> fromText "foo" <> fromChar '_' <> fromAddr "bar"#
"foo_bar"
Remember: this is a strict builder, so on contrary to
Data.Text.Lazy.Builder for optimal performance you should use
strict left folds instead of lazy right ones.
Note that (similar to other builders) concatenation of
Builders
allocates thunks. This is to a certain extent mitigated by aggressive
inlining, but it is faster to use
Buffer directly.
A
Builder is an efficient way to build lazy
ByteStrings.
There are several functions for constructing
Builders, but only
one to inspect them: to extract any data, you have to turn them into
lazy
ByteStrings using
toLazyByteString.
Internally, a
Builder constructs a lazy
Bytestring by
filling byte arrays piece by piece. As each buffer is filled, it is
'popped' off, to become a new chunk of the resulting lazy
ByteString. All this is hidden from the user of the
Builder.