0
votes

Im getting this error on this code!

esImpar :: Integer -> Bool
esImpar a = if (a mod 2) /= 0 then True
        else False

Error: Couldn't match expected type (Integer -> Integer -> Integer) -> (Integer -> Integer) -> Integer -> Integer' with actual type Integer

The function `a' is applied to three arguments,

but its type Integer' has none

In the first argument of (/=), namely (a mod fromIntegral 2)

In the expression: (a mod 2) /= 0

1

1 Answers

7
votes

mod by itself is just a function, not an operator; you can use it as mod a 2 or infix as a `mod` 2. (Here you are trying to use a as a function, as the error message says.)