| |||||||||||||
| |||||||||||||
| |||||||||||||
Description | |||||||||||||
Efficient construction of lazy Text values. The principal operations on a Builder are singleton, fromText, and fromLazyText, which construct new builders, and mappend, which concatenates two builders. To get maximum performance when building lazy Text values using a builder, associate mappend calls to the right. For example, prefer singleton 'a' `mappend` (singleton 'b' `mappend` singleton 'c') to singleton 'a' `mappend` singleton 'b' `mappend` singleton 'c' as the latter associates mappend to the left. | |||||||||||||
Synopsis | |||||||||||||
| |||||||||||||
The Builder type | |||||||||||||
data Builder | |||||||||||||
| |||||||||||||
toLazyText :: Builder -> Text | |||||||||||||
O(n). Extract a lazy Text from a Builder with a default buffer size. The construction work takes place if and when the relevant part of the lazy Text is demanded. | |||||||||||||
toLazyTextWith :: Int -> Builder -> Text | |||||||||||||
O(n). Extract a lazy Text from a Builder, using the given size for the initial buffer. The construction work takes place if and when the relevant part of the lazy Text is demanded. If the initial buffer is too small to hold all data, subsequent buffers will be the default buffer size. | |||||||||||||
Constructing Builders | |||||||||||||
singleton :: Char -> Builder | |||||||||||||
O(1). A Builder taking a single character, satisfying
| |||||||||||||
fromText :: Text -> Builder | |||||||||||||
O(1). A Builder taking a Text, satisfying
| |||||||||||||
fromLazyText :: Text -> Builder | |||||||||||||
O(1). A Builder taking a lazy Text, satisfying
| |||||||||||||
Flushing the buffer state | |||||||||||||
flush :: Builder | |||||||||||||
O(1). Pop the strict Text we have constructed so far, if any, yielding a new chunk in the result lazy Text. | |||||||||||||
Produced by Haddock version 2.7.2 |