Char package:ghc-prim
The character type
Char represents Unicode codespace and its
elements are code points as in definitions
D9 and D10 of the
Unicode Standard.
Character literals in Haskell are single-quoted:
'Q',
'Я' or
'Ω'. To represent a single quote itself use
'\'', and to represent a backslash use
'\\'. The
full grammar can be found in the section 2.6 of the
Haskell 2010
Language Report.
To specify a character by its code point one can use decimal,
hexadecimal or octal notation:
'\65',
'\x41' and
'\o101' are all alternative forms of
'A'. The
largest code point is
'\x10ffff'.
There is a special escape syntax for ASCII control characters:
TODO: table
Data.Char provides utilities to work with
Char.
Read an 8-bit character from immutable array; offset in bytes.
Read an 8-bit character from immutable address; offset in bytes.
Read a 32-bit character from immutable array; offset in 4-byte words.
Read a 32-bit character from immutable address; offset in 4-byte
words.
On some platforms, the access may fail for an insufficiently aligned
Addr#.
Read an 8-bit character from immutable array; offset in bytes.
Read a 32-bit character from immutable array; offset in bytes.
Read an 8-bit character from immutable address; offset in bytes.
Read a 32-bit character from immutable address; offset in bytes.
Read an 8-bit character from mutable array; offset in bytes.
Warning: this can fail with an unchecked exception.
Read an 8-bit character from mutable address; offset in bytes.
Warning: this can fail with an unchecked exception.
Read a 32-bit character from mutable array; offset in 4-byte words.
Warning: this can fail with an unchecked exception.
Read a 32-bit character from mutable address; offset in 4-byte words.
On some platforms, the access may fail for an insufficiently aligned
Addr#.
Warning: this can fail with an unchecked exception.
Read an 8-bit character from mutable array; offset in bytes.
Warning: this can fail with an unchecked exception.
Read a 32-bit character from mutable array; offset in bytes.
Warning: this can fail with an unchecked exception.
Read an 8-bit character from mutable address; offset in bytes.
Warning: this can fail with an unchecked exception.