I'm new to Haskell and trying to put together a simple function to check whether or not two numbers are equal. This compiles, but when I try out a test of the program, it says that this is non-exhaustive. I don't understand how it can be non-exhaustive with a boolean function? Thanks in advance:
data Value = ConstInt Int
| Numequal Value Value
| Ctrue Bool
| Cfalse Bool
deriving (Read, Show)
eval:: Value -> Bool
eval (Numequal e1 e2) =
let x = eval e1
y = eval e2
in case (x, y) of
(i1, i2) ->
if x == y
then False
else True