compact-string-0.3: ContentsIndex
Data.CompactString.Encodings
Portabilityuntested
Stabilityexperimental
Maintainertwanvl@gmail.com
Contents
Unicode encodings
Other encodings
Non-standard encodings
Description
Different encodings of characters into bytes.
Synopsis
data UTF8 = UTF8
data BE = BE
data LE = LE
type Native = LE
data UTF16 endianness = UTF16 endianness
type UTF16BE = UTF16 BE
type UTF16LE = UTF16 LE
type UTF16Native = UTF16 Native
data UTF32 endianness = UTF32 endianness
type UTF32BE = UTF32 BE
type UTF32LE = UTF32 LE
type UTF32Native = UTF32 Native
data ASCII = ASCII
data Latin1 = Latin1
data Compact = Compact
Unicode encodings
data UTF8
Tag representing the UTF-8 encoding. Use CompactString UTF8 for UTF-8 encoded strings.
Constructors
UTF8
show/hide Instances
data BE
Tag representing big endian encoding
Constructors
BE
show/hide Instances
Endian BE
data LE
Tag representing little endian encoding
Constructors
LE
show/hide Instances
Endian LE
type Native = LE
The platform native endianness
data UTF16 endianness
Tag representing the UTF-16 encoding
Constructors
UTF16 endianness
show/hide Instances
Endian e => Encoding (UTF16 e)
type UTF16BE = UTF16 BE
Tag representing the big endian UTF-16 encoding, aka. UTF-16BE.
type UTF16LE = UTF16 LE
Tag representing the little endian UTF-16 encoding, aka. UTF-16LE.
type UTF16Native = UTF16 Native
Tag representing the platform native UTF-16 encoding.
data UTF32 endianness
Tag representing the UTF-32 encoding
Constructors
UTF32 endianness
show/hide Instances
Endian e => Encoding (UTF32 e)
type UTF32BE = UTF32 BE
Tag representing the big endian UTF-32 encoding, aka. UTF-32BE.
type UTF32LE = UTF32 LE
Tag representing the little endian UTF-32 encoding, aka. UTF-32LE.
type UTF32Native = UTF32 Native
Tag representing the platform native UTF-32 encoding.
Other encodings
data ASCII
Tag representing the ASCII encoding.
Constructors
ASCII
show/hide Instances
data Latin1
Tag representing the ISO 8859-1 encoding (latin 1).
Constructors
Latin1
show/hide Instances
Non-standard encodings
data Compact

Tag representing a custom encoding optimized for memory usage.

This encoding looks like UTF-8, but is slightly more efficient. It requires at most 3 byes per character, as opposed to 4 for UTF-8.

Encoding looks like:

                   0zzzzzzz -> 0zzzzzzz
          00yyyyyy yzzzzzzz -> 1xxxxxxx 1yyyyyyy
 000xxxxx xxyyyyyy yzzzzzzz -> 1xxxxxxx 0yyyyyyy 1zzzzzzz

The reasoning behind the tag bits is that this allows the char to be read both forwards and backwards.

Constructors
Compact
show/hide Instances
Produced by Haddock version 0.8