Data.Char module provides ord function, which takes
a character and return the corresponding unicode value. Following is the signature of ord function.
ord :: Char -> Int
Prelude> :m Data.Char Prelude Data.Char> :t ord ord :: Char -> Int Prelude Data.Char> Prelude Data.Char> ord 'a' 97 Prelude Data.Char> ord '@' 64 Prelude Data.Char> ord '=' 61
No comments:
Post a Comment