text-all-0.2.0.0: Everything Data.Text related in one package

Safe HaskellNone
LanguageHaskell2010

Data.Text.All

Contents

Synopsis

Standard modules from text

module Data.Text

Types

type LText = Text Source #

Lazy Text.

data Builder :: * #

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.

Showing

show :: TextShow a => a -> Text Source #

A fast variant of show for Text that only works for some types. If you want more instances, import text-show-instances or use show' if the type is your own and you only have a Show instance defined.

lshow :: TextShow a => a -> LText Source #

Via Show

show' :: Show a => a -> Text Source #

Like show, but works for anything that has a Show instance. Slower than show.

lshow' :: Show a => a -> LText Source #

bshow' :: Show a => a -> Builder Source #

Conversion

strictToLazy :: Text -> LText Source #

Convert a Text into a lazy Text.

lazyToStrict :: LText -> Text Source #

Convert a lazy Text into a Text.

Formatting

format :: Params ps => Format -> ps -> Text Source #

A variant of format that produces strict Text.

lformat :: Params ps => Format -> ps -> LText Source #

A variant of format that produces lazy Text.

bformat :: Params ps => Format -> ps -> Builder Source #

A variant of format that produces a Builder.

Builder

bsingleton :: Char -> Builder Source #

A Builder producing a single character.

flush :: Builder #

O(1). Pop the strict Text we have constructed so far, if any, yielding a new chunk in the result lazy Text.

Conversion

builderToLazy :: Builder -> LText Source #

Convert a Builder into a lazy Text.

lazyToBuilder :: LText -> Builder Source #

Convert a lazy Text into a Builder.