Question

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 argument:

ghci> removeNonUppercase "Hahaha! Ahahaha!"  

the compiler says:

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

Why?

PrintScreen:

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top