How to get the ASCII value of a character in Haskell?

Viewed 30168

How to get the ASCII value of a character in Haskell? I've tried to use the ord function in GHCi, based on what I read here bug the the error message:

Not in scope: `ord'

For example:

GHCi, version 6.12.1: http://www.haskell.org/ghc/  :? for help
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package ffi-1.0 ... linking ... done.
Prelude> ord 'a'

<interactive>:1:0: Not in scope: `ord'
Prelude>

What am I doing wrong?

2 Answers
Related