Functor module:Data package:free-categories

Consider the category of Haskell quivers with
  • objects are types of higher kind
  • p :: k -> k -> Type
  • morphisms are terms of RankNType,
  • forall x y. p x y -> q x y
  • identity is id
  • composition is .
There is a natural hierarchy of typeclasses for endofunctors of the category of Haskell quivers, analagous to that for Haskell types.
The category of quivers forms a closed monoidal category in two ways, under ProductQ or ComposeQ. The relations between these and their adjoints can be characterized by typeclasses below.
An endfunctor of quivers.
qmap id = id
qmap (g . f) = qmap g . qmap f