Functor

Minimal Complete Definition

class Functor f 
  where
    fmap :: (a -> b) -> f a -> f b 

Methods

class Functor f  
  where
    fmap :: (a -> b) -> f a -> f b 
    (<$) :: a -> f b -> f a

instance Functor Maybe
  where
    fmap func (Just n) = Just (func n)
    fmap Nothing = Nothing

Type Class Laws