type L1 = Integer data L2 = A | B | C | D deriving (Eq, Ord) data L = Fst L1 | Snd L2 deriving Eq instance Ord L where Fst _ <= Snd _ = True Fst x <= Fst y | x <= y = True Snd x <= Snd y | x <= y = True _ <= _ = False