Builder package:text

Warning: this is an internal module, and does not have a stable API or name. Functions in this module may not check or enforce preconditions expected by public modules. Use at your own risk! 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.
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.
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. Or, equivalently, prefer
singleton 'a' <> singleton 'b' <> singleton 'c'
since the <> from recent versions of Monoid associates to the right.
Deprecated: Use StrictTextBuilder instead
A delayed representation of strict Text.
Encode text to a ByteString Builder using UTF-8 encoding.
Encode text using UTF-8 encoding and escape the ASCII characters using a BoundedPrim. Use this function is to implement efficient encoders for text-based formats like JSON or HTML.
Use StrictBuilder to build Text.
Copy Text in a StrictBuilder
Warning: this is an internal module, and does not have a stable API or name. Functions in this module may not check or enforce preconditions expected by public modules. Use at your own risk!