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.