Count number of palindromes in a list of strings, Haskell
问题 The function countPalindromes receives a list of strings and returns a count of how many of the strings are palindromes. isPalindrome :: String -> Bool isPalindrome w = w == reverse w countPalindromes :: [String] -> Int countPalindromes ss = length filter (== isPalindrome) ss I know that the function length is applied to two arguments instead of one. I just don't know how to fix this? 回答1: You may use parentheses to affect function application: countPalindromes ss = length (filter (==