I have this code:
censName :: String -> String
censName [] = []
censName xs = unwords(censWords(words xs))
censWords :: [String] -> [String]
censWords [] = []
censWords (x:xs) = if isUpper(head x) then replace(tail x) else censWords xs
replace :: String -> String
replace [] = []
replace (x:xs) = '*':replace xs
and the error says:
Couldn't match type ‘Char’ with ‘[Char]’
Expected type: [String]
Actual type: String
and my questions is: why!? i mean, in replace(tail x) x is a String, so why it expects [String]?
i couldn't find nothing to fit to my problem on similar problems posted here.