Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

use ord function in haskell is not is scope

Tags:

haskell

Pretty simple, I want to convert a character to integer using the function ord, however it is not loaded automatically in the prelude 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 heaven's sake, I can use it??

like image 204
user2820579 Avatar asked Nov 28 '14 21:11

user2820579


1 Answers

You need to import Data.Char first:

import Data.Char
like image 140
Lee Avatar answered Oct 07 '22 09:10

Lee