@@ -63,6 +63,17 @@ maybeToEither def (Just j) = Right j
6363maybeToEither def Nothing = Left def
6464
6565
66+--------------------------------------------------------------------------------
67+-- Instances
68+--------------------------------------------------------------------------------
69+
70+instance (Eq a, Eq b) => Eq (Either a b) where
71+ (==) (Left x) (Left y) = x == y
72+ (==) (Right x) (Right y) = x == y
73+ (==) _ _ = False
74+
75+
76+
6677--------------------------------------------------------------------------------
6778-- Injectivity of constructors
6879--------------------------------------------------------------------------------