| Portability | portable to Hugs and GHC |
|---|---|
| Stability | experimental |
| Maintainer | Johan Tibell <johan.tibell@gmail.com> |
Data.Text.Lazy.Builder
Description
Efficient construction of lazy texts.
The Builder type
A Builder is an efficient way to build lazy Texts. There
are several functions for constructing Builders, but only one to
inspect them: to extract any data, you have to turn them into lazy
Texts using toLazyText.
Internally, a Builder constructs a lazy Text 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 Text. All
this is hidden from the user of the Builder.
toLazyText :: Builder -> TextSource
toLazyTextWith :: Int -> Builder -> TextSource
Constructing Builders
singleton :: Char -> BuilderSource
O(1). A Builder taking a single character, satisfying
toLazyText(singletonc) =singletonc
fromText :: Text -> BuilderSource
O(1). A Builder taking a Text, satisfying
toLazyText(fromTextt) =fromChunks[t]
fromLazyText :: Text -> BuilderSource
O(1). A Builder taking a lazy Text, satisfying
toLazyText(fromLazyTextt) = t