I'm told to write a function that would check if the punctuations in a string are all spaces. i.e.:
haskell> f "Hello my name is Brad"
True
haskell> f "Hello my name is Brad!"
False
I wrote an auxiliary function as follows,
import Data.Char
isPunc x = not (isDigit x || isAlpha x)
which was accepted by Haskell and worked fine. But as soon as I used it in the following function,
--function f defined
f :: String -> Bool
f xs = and [ x == ' ' | x <- xs, isPunc x]
it gives me this error:
ambiguous occurence 'isPunc', could mean "Main.isPunc" or "Data.Char. isPunc"
I am partially getting what it's complaining about, but having imported Data.Char, I don't really see why it's complaining.