我正在尝试从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'
为什么?