@hackage text-builder1

Efficient and flexible strict text builder

Summary

Fast strict text builder and simple type-safe formatting library.

The Builder

The builder abstraction provided by the library is much faster than the standard Data.Text.Lazy.Builder.Data.Text.Lazy.Builder.Builder and even the recently introduced Data.Text.Encoding.Data.Text.Encoding.StrictTextBuilder. Benchmarks are distributed with the source code. You can see the results in the README file.

It constructs text in two phases. In the first one it estimates the size of the byte array and in the second one it allocates it once and populates it in one go.

Simple and type-safe formatting library

The monoidal API of the library provides a simple yet type-safe alternative to formatting strings via printf-like tools or more involved solutions like the popular "formatting" library.

Quality

Every bit of the library is heavily covered with tests with CI running tests on a variety of versions of GHC and the "text" library. This is crucial because the "text" library has made a switch from UTF-16 to UTF-8, leading to drastic changes in its low-level constructs, which builder libraries must rely on, and this library supports both versions of "text".

Ecosystem

Following is a list of libraries that, alongside this one, make an integrated ecosystem:

  • "text-builder-core" - lower-level unsafe constructs for implementing efficient formatters compatible with this library

  • "text-builder-dev" - edge of development of new features providing a richer functionality at the cost of more frequent major releases