Rich String

rich-string provides a generic way to enrich the built-in string type with new capabilities.

The resulting rich string type is powerful: simple, composable, optimizing and extensible.

Simple

The type is made of four straightforward variants:

Composable

Just like the built-in string, rich strings form a monoid.

Optimizing

Rich strings are carefully crafted for common cases. Operations on rich strings avoid unnecessary structural deep-nesting when possible.

Extensible

With a mostly transparent interface, rich strings can be extended to fulfill specific needs.

For example:

Tested

As a library, rich-string is tested from the ground-up, with a focus on checking that its advertised properties hold.

Convinced?

Add rich-string to your dune-project, in the depends section:

(package
  (name your-package)
  (depends
    ...
    (rich-string (>= 1.0))))

rich-string is available on the OPAM index.

opam install rich-string

Made with 🩷 by lexa. Support me on Ko-fi. Find me on Bluesky.

rich-string's development does not involve any large language model.

rich-string is entirely brain-made.