Functor
Overview
functors: you apply a function to a wrapped value using fmap or <$>
code:functor.hs
class Functor f where
-- You provide a function (a -> b)
-- and a functor (f a)
-- and it will return you with (f b)
fmap :: (a -> b) -> f a -> f b
code:functorlaw.hs
fmap id == id
fmap (f . g) == fmap f . fmap g
Reference