summaryrefslogtreecommitdiff
path: root/functor/h1.hs
blob: 11688add5ba935bcad306a213198dc66419e8c60 (plain)
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)