@@ -441,19 +441,19 @@ module Maybe where
441441 fromMaybe :: forall a. a -> Maybe a -> a
442442 fromMaybe a = maybe a (Prelude.id :: forall a. a -> a)
443443
444− instance Prelude.Functor Maybe where
445− (<$>) fn (Just x) = Just (fn x)
446− (<$>) _ _ = Nothing
447−
444+ instance Prelude.Monad Maybe where
445+ return = Just
446+ (>>=) m f = maybe Nothing f m
447+
448448 instance Prelude.Applicative Maybe where
449449 pure = Just
450450 (<*>) (Just fn) x = fn <$> x
451451 (<*>) Nothing _ = Nothing
452452
453− instance Prelude.Monad Maybe where
454− return = Just
455− (>>=) m f = maybe Nothing f m
456−
453+ instance Prelude.Functor Maybe where
454+ (<$>) fn (Just x) = Just (fn x)
455+ (<$>) _ _ = Nothing
456+
457457 instance (Show a) => Prelude.Show (Maybe a) where
458458 show (Just x) = "Just " ++ (show x)
459459 show Nothing = "Nothing"
@@ -468,18 +468,18 @@ module Either where
468468 either f _ (Left a) = f a
469469 either _ g (Right b) = g b
470470
471− instance Prelude.Functor (Either a) where
472− (<$>) _ (Left x) = Left x
473− (<$>) f (Right y) = Right (f y)
471+ instance Prelude.Monad (Either e) where
472+ return = Right
473+ (>>=) = either (\e _ -> Left e) (\a f -> f a)
474474
475475 instance Prelude.Applicative (Either e) where
476476 pure = Right
477477 (<*>) (Left e) _ = Left e
478478 (<*>) (Right f) r = f <$> r
479479
480− instance Prelude.Monad (Either e) where
481− return = Right
482− (>>=) = either (\e _ -> Left e) (\a f -> f a)
480+ instance Prelude.Functor (Either a) where
481+ (<$>) _ (Left x) = Left x
482+ (<$>) f (Right y) = Right (f y)
483483
484484 instance (Show a, Show b) => Prelude.Show (Either a b) where
485485 show (Left x) = "Left " ++ (show x)