text-short

Memory-efficient representation of Unicode text strings

Version on this page:0.1.1
LTS Haskell 22.13:0.1.5@rev:3
Stackage Nightly 2024-03-14:0.1.5@rev:3
Latest on Hackage:0.1.5@rev:3

See all snapshots text-short appears in

BSD-3-Clause licensed by Herbert Valerio Riedel
Maintained by [email protected]
This version can be pinned in stack with:text-short-0.1.1@sha256:41aece9c5cf929474bfbeca930c0749b9896f1e2045430f9f23a0b02dd56d82c,2582

Module documentation for 0.1.1

Used by 1 package in nightly-2017-10-28(full list with versions):

This package provides the ShortText type which is suitable for keeping many short strings in memory. This is similiar to how ShortByteString relates to ByteString.

The main difference between Text and ShortText is that ShortText uses UTF-8 instead of UTF-16 internally and also doesn't support slicing (thereby saving 2 words). Consequently, the memory footprint of a (boxed) ShortText value is 4 words (2 words when unboxed) plus the length of the UTF-8 encoded payload.

Changes

Revision history for text-short

0.1

  • First version. Released on an unsuspecting world.

0.1.1

  • Expose unsafe conversion API via Data.Text.Short.Unsafe module
  • Minor documentation improvement