I have a variable:
checkList :: Integral a => [a] -> Bool
and I want to check if the inputted list has 10 elements and whether the sum of the elements is divisible by 10 and if both of these are satisfied then return True else return False. I tried this:
checkList [] = False
checkList(x:xs)
|(1+checkList xs) div 10 == 1 && (x+checkList xs) mod 10 == 0 = True
|otherwise = False
but it didn't work and gave an error saying:
• Couldn't match expected type ‘(a0 -> a0 -> a0) -> t1 -> a1’
with actual type ‘Bool’
• The function ‘1 + checksum xs’ is applied to two arguments,
but its type ‘Bool’ has none