data BoolLit = T | F
instance Eq BoolLit where
b1 == b2 = True
data BExp = BoolLit |
Or BExp BExp
bEval :: BExp -> BoolLit
bEval T = T
I'm getting the following syntax error:
Couldn't match expected type 'BExp' with actual type 'BoolLit'
In the pattern: T
In an equation for 'bEval': bEval T = T
The data declaration has declared that BoolLit is a BExp.
So, I don't understand why Haskell is giving an error.
I'd like to know why and how to correct it.
Thanks.