GHCi错误:不在范围内

时间:2010-04-04 21:08:04

标签: haskell ghci

我正在尝试从Learn You a Haskell for Great Good编译此函数。

 removeNonUppercase st = [ c | c <- st, c `elem` ['A'..'Z']]   

将其放入removeNonUpperCase.hs文件中。

它编译得很好,但在传递参数时:

ghci> removeNonUppercase "Hahaha! Ahahaha!"  

编译器说:

<interactive>:1:0: Not in scope: 'removeNonUpperCase'

为什么呢?

PrintScreen: http://img535.imageshack.us/img535/9545/notinscope.png

1 个答案:

答案 0 :(得分:7)

您将方法定义为removeNonUppercase(小写c),但您将其称为removeNonUpperCase(大写C)。