Portability  nonportable 

Stability  experimental 
Maintainer  sjoerd@w3future.com 
 data Cat where
 data CatW
 type family Dom ftag :: * > * > *
 type family Cod ftag :: * > * > *
 class (Category (Dom ftag), Category (Cod ftag)) => Functor ftag where
 type family ftag :% a :: *
 data Id (~>) = Id
 data g :.: h where
 data Const c1 c2 x where
 type ConstF f = Const (Dom f) (Cod f)
 data Opposite f where
 data OpOp (~>) = OpOp
 data OpOpInv (~>) = OpOpInv
 data EndoHask where
 data Proj1 c1 c2 = Proj1
 data Proj2 c1 c2 = Proj2
 data f1 :***: f2 = f1 :***: f2
 data DiagProd (~>) = DiagProd
 data Tuple1 c1 c2 a = Tuple1 (Obj c1 a)
 data Tuple2 c1 c2 a = Tuple2 (Obj c2 a)
 data Hom (~>) = Hom
 type :*: x (~>) = Hom ~> :.: Tuple1 (Op ~>) ~> x
 homX_ :: Category ~> => Obj ~> x > x :*: ~>
 type :*: (~>) x = Hom ~> :.: Tuple2 (Op ~>) ~> x
 hom_X :: Category ~> => Obj ~> x > ~> :*: x
Cat
Functors are arrows in the category Cat.
CatA :: (Functor ftag, Category (Dom ftag), Category (Cod ftag)) => ftag > Cat (CatW (Dom ftag)) (CatW (Cod ftag)) 
Category Cat 

HasTerminalObject Cat 

HasInitialObject Cat  The empty category is the initial object in 
HasBinaryProducts Cat  The product of categories '(:**:)' is the binary product in 
HasBinaryCoproducts Cat  The coproduct of categories '(:++:)' is the binary coproduct in 
CartesianClosed Cat  Exponentials in 
We need a wrapper here because objects need to be of kind *, and categories are of kind * > * > *.
Functors
class (Category (Dom ftag), Category (Cod ftag)) => Functor ftag whereSource
Functors map objects and arrows.
Functor ForgetMonoid  The 
Functor FreeMonoid  The 
Category ~> => Functor (Id ~>)  The identity functor on (~>) 
(Category (Dom f), Category (Cod f)) => Functor (Opposite f)  The dual of a functor 
Category ~> => Functor (OpOp ~>)  The 
Category ~> => Functor (OpOpInv ~>)  The 
Functor (EndoHask f) 

Category ~> => Functor (DiagProd ~>) 

Category ~> => Functor (Hom ~>)  The Hom functor, Hom(,), a bifunctor contravariant in its first argument and covariant in its second argument. 
Category ~> => Functor (FunctorCompose ~>)  Composition of endofunctors is a functor. 
Category ~> => Functor (CodiagCoprod ~>) 

Category (Discrete n) => Functor (Succ n) 

HasBinaryProducts ~> => Functor (ProductFunctor ~>)  Binary product as a bifunctor. 
HasBinaryCoproducts ~> => Functor (CoproductFunctor ~>)  Binary coproduct as a bifunctor. 
CartesianClosed ~> => Functor (ExpFunctor ~>)  The exponential as a bifunctor. 
(Dom m ~ ~>, Cod m ~ ~>, Functor m) => Functor (KleisliAdjF m)  
(Dom m ~ ~>, Cod m ~ ~>, Functor m) => Functor (KleisliAdjG m)  
(Dom m ~ ~>, Cod m ~ ~>, Functor m) => Functor (FreeAlg m) 

(Dom m ~ ~>, Cod m ~ ~>, Functor m) => Functor (ForgetAlg m) 

(Category (Cod g), Category (Dom h)) => Functor (:.: g h)  The composition of two functors. 
(Category c1, Category c2) => Functor (Proj1 c1 c2) 

(Category c1, Category c2) => Functor (Proj2 c1 c2) 

(Functor f1, Functor f2) => Functor (:***: f1 f2) 

(Functor f, Category d) => Functor (Precompose f d) 

(Functor f, Category c) => Functor (Postcompose f c) 

(Functor f, Functor h) => Functor (Wrap f h) 

(Category c1, Category c2) => Functor (Inj1 c1 c2) 

(Category c1, Category c2) => Functor (Inj2 c1 c2) 

(Functor f1, Functor f2) => Functor (:+++: f1 f2) 

(Category j, Category ~>) => Functor (Diag j ~>)  The diagonal functor from (index) category J to (~>). 
HasLimits j ~> => Functor (LimitFunctor j ~>)  If every diagram of type 
HasColimits j ~> => Functor (ColimitFunctor j ~>)  If every diagram of type 
(Category (Dom p), Category (Cod p)) => Functor (:*: p q)  The product of two functors, passing the same object to both functors and taking the product of the results. 
(Category (Dom p), Category (Cod p)) => Functor (:+: p q)  The coproduct of two functors, passing the same object to both functors and taking the coproduct of the results. 
(Category y, Category z) => Functor (Apply y z) 

(Category y, Category z) => Functor (ToTuple1 y z)  
(Category y, Category z) => Functor (ToTuple2 y z)  
(Dom f ~ Op ~>, Cod f ~ (>), Category ~>, Functor f) => Functor (Yoneda ~> f) 

(Category (Dom f), Category (Cod f)) => Functor (NatAsFunctor f g)  A natural transformation 
(Category c1, Category c2) => Functor (Const c1 c2 x)  The constant functor. 
(Category c1, Category c2) => Functor (Tuple1 c1 c2 a1) 

(Category c1, Category c2) => Functor (Tuple2 c1 c2 a2) 

(Category c1, Category c2) => Functor (Cotuple1 c1 c2 a1) 

(Category c1, Category c2) => Functor (Cotuple2 c1 c2 a2) 

Functor (DiscreteDiagram ~> n xs) => Functor (DiscreteDiagram ~> (S n) (x, xs))  A diagram with one more object. 
Category ~> => Functor (DiscreteDiagram ~> Z ())  The empty diagram. 
Functor instances
Category ~> => Functor (Id ~>)  The identity functor on (~>) 
Functor f => HasTerminalObject (Dialg (Id (>)) (EndoHask f)) 

Functor f => HasInitialObject (Dialg (EndoHask f) (Id (>))) 

type ConstF f = Const (Dom f) (Cod f)Source
The constant functor with the same domain and codomain as f.
Functor (EndoHask f) 

Functor f => HasTerminalObject (Dialg (Id (>)) (EndoHask f)) 

Functor f => HasInitialObject (Dialg (EndoHask f) (Id (>))) 

Related to the product category
f1 :***: f2 