devoured elysium
devoured elysium

Reputation: 105077

How to obtain a char's ascii value in haskell? And how to turn an ascii value (65, let's say) into a char (A)?

How to accomplish that in Haskell?

Upvotes: 5

Views: 5602

Answers (1)

Phil
Phil

Reputation: 2299

Hoogle is your friend:

http://haskell.org/hoogle/?hoogle=Char+-%3E+Int

import Data.Char   
ord 'a'
chr 98

Upvotes: 14

Related Questions