Definition of a functor in Haskell