Community
Modules 50

Data.Text.Internal.StrictBuilder

experimental

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!

data StrictTextBuilder

A delayed representation of strict Text.

StrictTextBuilder :: Int -> forall s. A.MArray s -> Int -> ST s () -> StrictTextBuilder

sbWrite :: StrictTextBuilder -> forall s. A.MArray s -> Int -> ST s ()

type StrictBuilder = StrictTextBuilder

Use StrictTextBuilder instead

A delayed representation of strict Text.

toText :: StrictTextBuilder -> Text

Use StrictBuilder to build Text.

fromText :: Text -> StrictTextBuilder

Copy Text in a StrictBuilder

Unsafe

For internal purposes, we abuse StrictBuilder as a delayed Array rather than Text: it may not actually be valid Text.

unsafeFromByteString :: ByteString -> StrictTextBuilder

Copy a ByteString.

Unsafe: This may not be valid UTF-8 text.

unsafeFromWord8 :: Word8 -> StrictTextBuilder

Unsafe: This may not be valid UTF-8 text.

Instances

2
  • instance Semigroup StrictTextBuilder

    Concatenation of StrictBuilder is right-biased: the right builder will be run first. This allows a builder to run tail-recursively when it was accumulated left-to-right.

  • instance Monoid StrictTextBuilder
License
BSD-style (see LICENSE)
Build record and source files

Community contribution. The service has not verified this documentation. The generator reported 2 diagnostics.

Target: Linux on x86-64. Some inferred types and resolved links are not available.

Generator: aihc-haddock-858b1951-web-1

Metadata snapshot: 0b0724abd14577f7a6c8172d62e3e1c0808feb114d4d379402e17f37e3c7801e

Open the dependency plan · Download the documentation model

Import a package

Enter a package name and an exact version from Hackage. The site contains imported versions only.