开发者

GHCi error: Not in scope 'removeNonUpperCase'

I'm trying to compile this function from Learn You a Haskell for Great Good.

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

by placing it into a removeNonUpperCase.hs file.

It compiles fine, but when passing the ar开发者_运维技巧gument:

ghci> removeNonUppercase "Hahaha! Ahahaha!"  

the compiler says:

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

Why?

GHCi error: Not in scope 'removeNonUpperCase'


You defined the method as removeNonUppercase (lower case c), but you call it as removeNonUpperCase (upper case C).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜