Why is there a maxBound
of Char
? If Char
is character then why it is explained by numbers, and if it is not a number what does it mean?
> maxBound :: Char
'\1114111'
All characters, like all things in a computer, are ultimately just numbers. Char
represents unicode characters, which are represented via numbers. You can convert between Char
and Int
values with ord
and chr
. E.g. the unicode value for a
is 97, so ord 'a'
is 97
and chr 97
is 'a'
.
Char '\1114111'
is the Char
that represents the number 1114111
, or 0x10FFFF, which is defined as a noncharacter. This is the largest value that is defined in Unicode, and is the largest that Haskell supports: '\1114112'
will cause a compile error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With