1 2 3 4 5 6 7
data MyEither a b = MyLeft a | MyRight b deriving (Show) instance Functor (MyEither a) where fmap f (MyLeft a) = MyLeft a fmap f (MyRight b) = MyRight (f b)