class Functor f
where
fmap :: (a -> b) -> f a -> f b
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
fmap
or <$>
transforms functions for use with wrapped types<$
…fmap (a -> a) f a = f a
or fmap id = id