Using ord function in haskell is not an area

Quite simply, I want to convert a character to an integer using the ord function, however it does not load automatically in foreplay because it says:

 *Main> ord 'a' <interactive>:55:1: Not in scope: 'ord' Perhaps you meant one of these: 'odd' (imported from Prelude), 'or' (imported from Prelude) 

How, for my sake, can I use it?

+5
source share
1 answer

First you need to import Data.Char :

 import Data.Char 
+13
source

Source: https://habr.com/ru/post/1207915/


All Articles