data-category-0.2.0: Restricted categories

Portabilitynon-portable
Stabilityexperimental
Maintainersjoerd@w3future.com

Data.Category.Functor

Contents

Description

 

Synopsis

Cat

data Cat whereSource

Functors are arrows in the category Cat.

Constructors

CatA :: (Functor ftag, Category (Dom ftag), Category (Cod ftag)) => ftag -> Cat (CatW (Dom ftag)) (CatW (Cod ftag)) 

Instances

Category Cat

Cat is the category with categories as objects and funtors as arrows.

HasBinaryProducts Cat 
HasInitialObject Cat 
HasTerminalObject Cat

Unit is the terminal category.

data CatW Source

We need a wrapper here because objects need to be of kind *, and categories are of kind * -> * -> *.

Functors

type family Dom ftag :: * -> * -> *Source

The domain, or source category, of the functor.

type family Cod ftag :: * -> * -> *Source

The codomain, or target category, of the functor.

class Functor ftag whereSource

Functors map objects and arrows. As objects are represented at both the type and value level, we need 3 maps in total.

Methods

(%%) :: ftag -> Obj (Dom ftag) a -> Obj (Cod ftag) (ftag :% a)Source

%% maps objects at the value level.

(%) :: ftag -> Dom ftag a b -> Cod ftag (ftag :% a) (ftag :% b)Source

% maps arrows.

Instances

type family ftag :% a :: *Source

:% maps objects at the type level.

Functor instances

data Id (~>) Source

The identity functor on (~>)

Constructors

Id 

Instances

data g :.: h whereSource

The composition of two functors.

Constructors

:.: :: (Functor g, Functor h, Cod h ~ Dom g) => g -> h -> g :.: h 

Instances

Functor (:.: g h) 

data Const c1 c2 x whereSource

The constant functor.

Constructors

Const :: Category c2 => Obj c2 x -> Const c1 c2 x 

Instances

Functor (Const c1 c2 x) 

type ConstF f = Const (Dom f) (Cod f)Source

data :*-: whereSource

The covariant functor Hom(X,--)

Constructors

HomX_ :: Category ~> => Obj ~> x -> x :*-: ~> 

Instances

Functor (:*-: x ~>) 

data :-*: whereSource

The contravariant functor Hom(--,X)

Constructors

Hom_X :: Category ~> => Obj ~> x -> ~> :-*: x 

Instances

Functor (:-*: ~> x) 
Category ~> => Representable (:-*: ~> x) 

data Opposite f whereSource

The dual of a functor

Constructors

Opposite :: Functor f => f -> Opposite f 

Instances

data EndoHask whereSource

EndoHask is a wrapper to turn instances of the Functor class into categorical functors.

Constructors

EndoHask :: Functor f => EndoHask f 

Instances

Universal properties

data InitialUniversal x u a Source

An initial universal property, a universal morphism from x to u.

Constructors

InitialUniversal 

Fields

iuObject :: Obj (Dom u) a
 
initialMorphism :: Cod u x (u :% a)
 
initialFactorizer :: forall y. Obj (Dom u) y -> Cod u x (u :% y) -> Dom u a y
 

data TerminalUniversal x u a Source

A terminal universal property, a universal morphism from u to x.

Constructors

TerminalUniversal 

Fields

tuObject :: Obj (Dom u) a
 
terminalMorphism :: Cod u (u :% a) x
 
terminalFactorizer :: forall y. Obj (Dom u) y -> Cod u (u :% y) x -> Dom u y a