@@ -425,6 +425,12 @@ module Data.Maybe where
425425 show (Just x) = "Just " ++ (show x)
426426 show Nothing = "Nothing"
427427
428+ instance eqMaybe :: (Eq a) => Eq (Maybe a) where
429+ (==) Nothing Nothing = true
430+ (==) (Just a1) (Just a2) = a1 == a2
431+ (==) _ _ = false
432+ (/=) a b = not (a == b)
433+
428434module Data.Either where
429435
430436 import Prelude
@@ -452,6 +458,12 @@ module Data.Either where
452458 show (Left x) = "Left " ++ (show x)
453459 show (Right y) = "Right " ++ (show y)
454460
461+ instance eqEither :: (Eq a, Eq b) => Eq (Either a b) where
462+ (==) (Left a1) (Left a2) = a1 == a2
463+ (==) (Right b1) (Right b2) = b1 == b2
464+ (==) _ _ = false
465+ (/=) a b = not (a == b)
466+
455467module Data.Array where
456468
457469 import Prelude