@@ -51,6 +51,12 @@ maybe_bind : Maybe a -> (a -> Maybe b) -> Maybe b
5151maybe_bind Nothing k = Nothing
5252maybe_bind (Just x) k = k x
5353
54+instance (Eq a) => Eq (Maybe a) where
55+ Nothing == Nothing = True
56+ Nothing == (Just _) = False
57+ (Just _) == Nothing = False
58+ (Just a) == (Just b) = a == b
59+
5460-- | Lift a semigroup into 'Maybe' forming a 'Monoid' according to
5561-- <http://en.wikipedia.org/wiki/Monoid>: \"Any semigroup S may be
5662-- turned into a monoid simply by adjoining an element e not in S