1 2 3 4 5 6 7 8 9 10
module Short where data Sum a b = First a | Second b deriving (Eq, Show) instance Functor (Sum a) where fmap f (Second x) = Second $ f x fmap f (First x) = First x