1 class Functor f where
\r
2 map :: (a -> b) -> f a -> f b
\r
4 data Either a b = Left a | Right b
\r
6 instance Functor (Either a) where
\r
7 map _ (Left x) = Left x
\r
8 map f (Right y) = Right (f y)
\r
10 id :: Integer -> Integer
\r
13 main = map id (Left (12 :: Integer))
\r