我正在尝试从Learn You a Haskell for Great Good中编译这个函数.
removeNonUppercase st = [ c | c <- st, c `elem` ['A'..'Z']]
Run Code Online (Sandbox Code Playgroud)
将它放入removeNonUpperCase.hs文件中.
编译很好,但在传递参数时:
ghci> removeNonUppercase "Hahaha! Ahahaha!"
Run Code Online (Sandbox Code Playgroud)
编译器说:
<interactive>:1:0: Not in scope: 'removeNonUpperCase'
Run Code Online (Sandbox Code Playgroud)
为什么?
PrintScreen:http://img535.imageshack.us/img535/9545/notinscope.png