@@ -121,6 +121,12 @@ instance Applicative Maybe where
121 (Just f) <$> (Just a) = Just (f a)
121 (Just f) <$> (Just a) = Just (f a)
122 _ <$> _ = Nothing
122 _ <$> _ = Nothing
124+instance Applicative (Either e) where
127+ (Left a) <$> _ = Left a
128+ (Right f) <$> (Right r) = Right (f r)
129+ (Right _) <$> (Left l) = Left l
125---- some mathematical operations
131---- some mathematical operations