MK
data X = A | B
Prelude> Prelude> Prelude> foo A = 1
Prelude> Prelude> foo 0 = 0
Prelude> :t foo
foo :: (Eq a, Num a, Num p) => a -> p
Prelude> foo A
<interactive>:184:1-5: error:
• Could not deduce (Eq X) arising from a use of ‘foo’
from the context: Num p
bound by the inferred type of it :: Num p => p
at <interactive>:184:1-5
• In the expression: foo A
In an equation for ‘it’: it = foo A