Let\'s consider a data type with many constructors:
data T = Alpha Int | Beta Int | Gamma Int Int | Delta Int
I want to write a function to che
Another possible way:
sameK x y = f x == f y where f (Alpha _) = 0 f (Beta _) = 1 f (Gamma _ _) = 2 -- runtime error when Delta value encountered
A runtime error is not ideal, but better than silently giving the wrong answer.