@hackage text-short0.1.6
Memory-efficient representation of Unicode text strings
Installation
Tested Compilers
Dependencies (8)
- base >=4.12 && <4.22
- binary >=0.8.6.0 && <0.9
- bytestring >=0.10.8.2 && <0.13
- deepseq >=1.4.4.0 && <1.6
- ghc-prim >=0.5.3 && <0.14
- template-haskell >=2.14.0.0 && <2.24 Show all…
Dependents (67)
@hackage/unlifted, @hackage/scientific-notation, @hackage/LDAPv3, @hackage/json-syntax, @hackage/proto3-wire, @hackage/Cassava, Show all…
Package Flags
asserts
(off by default)
Enable runtime-checks via assert
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
doesn't support zero-copy slicing (thereby saving 2 words), and, compared to text-1.*, that it uses UTF-8 instead of UTF-16 internally. 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.