GHCi错误 - “不在范围内:`isUpper'”

问题描述:

我正在学习haskell,我正在尝试编写一些简单的函数。一切运作良好,直到我使用功能isUpper。我无法编译,因为这个错误的项目:GHCi错误 - “不在范围内:`isUpper'”

[1 of 1] Compiling Main    (C:\Users\...\src\Main.hs, interpreted) 
C:\Users\...\src\Main.hs:147:25: 
    Not in scope: `isUpper' 
Failed, modules loaded: none. 
Prelude> 

我的代码:

module Main where 
main::IO() 
main = undefined 
stringIsUpper [] = True 
stringIsUpper (x:ys) = (isUpper x) && (stringIsUpper(ys)) 

这段代码的目标应该是只是为了检查是否插入的字符串由大写字母的。 我使用EclipseFP发展 谢谢您的帮助

+4

'isUpper'是'Data.Char'中的一个函数,您必须先将其导入 – bheklilr

+0

如果有疑问,请[hoogle it](http://www.haskell.org/hoogle/?hoogle=isUpper)。 – bheklilr

+0

谢谢@bheklilr。有用。我只是认为我不必写入口,而且我也不知道在哪里放置那些进口。 问题解决了 – user2151486

您需要importData.Char得到isUpper