tags:

views:

134

answers:

1

Suppose that my Haskell function is given an input, which is supposed to be the number of a unicode code point. How can one convert this to the corresponding character?

Example:

123 to '{'.

+4  A: 

Use toEnum. (Chars implement the Enum typeclass.)

Dave Hinton
Yep, or `chr` from `Data.Char`.
Reid Barton