Functor instance for (Either e).
commit894a847fdbc6bd7ac9c222dffc9666de31a40d4b
authorstartling <tdixon51793@gmail.com>
dateThu 15 Nov 2012, 13:34 (14 years ago)
parent4043a0c
lib/Prelude.idr+4
@@ -106,6 +106,10 @@ instance Functor Maybe where
106106 fmap f (Just x) = Just (f x)
107107 fmap f Nothing = Nothing
108108
109+instance Functor (Either e) where
110+ fmap f (Left l) = Left l
111+ fmap f (Right r) = Right (f r)
112+
109113instance Functor List where
110114 fmap = map
111115