非常简单,我想使用函数ord
将字符转换为整数,但是它不会自动加载到前奏中,因为它说:
*Main> ord 'a'
<interactive>:55:1:
Not in scope: ‘ord’
Perhaps you meant one of these:
‘odd’ (imported from Prelude), ‘or’ (imported from Prelude)
为了天堂的缘故,我怎么能用它?
答案 0 :(得分:16)
您需要先导入Data.Char
:
import Data.Char