0
我試圖從Learn You a Haskell for Great Good編譯此功能。GHCi錯誤:不在範圍內
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