data-category-0.0.3.1: Restricted categories

Portabilitynon-portable
Stabilityexperimental
Maintainersjoerd@w3future.com

Data.Category

Contents

Description

 

Synopsis

Categories

class CategoryO (~>) a whereSource

An instance CategoryO (~>) a declares a as an object of the category (~>).

Methods

id :: a ~> aSource

Instances

class (CategoryO ~> a, CategoryO ~> b, CategoryO ~> c) => CategoryA (~>) a b c whereSource

An instance CategoryA (~>) a b c defines composition of the arrows a ~> b and b ~> c.

Methods

(.) :: (b ~> c) -> (a ~> b) -> a ~> cSource

class (CategoryO ~> a, CategoryO ~> b) => Apply (~>) a b whereSource

Methods

($$) :: (a ~> b) -> a -> bSource

Functors

type family F ftag a :: *Source

Functors are represented by a type tag. The type family F turns the tag into the actual functor.

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 funcor.

class (CategoryO (Dom ftag) a, CategoryO (Dom ftag) b) => FunctorA ftag a b whereSource

The mapping of arrows by covariant functors. To make this type check, we need to pass the type tag along.

Methods

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

Instances

(Dom f ~ Pair, Cod f ~ (->), Dom g ~ Pair, Cod g ~ (->)) => FunctorA CoprodInHask (FunctO Pair (->) f) (FunctO Pair (->) g) 
(Dom f ~ Pair, Cod f ~ (->), Dom g ~ Pair, Cod g ~ (->)) => FunctorA ProdInHask (FunctO Pair (->) f) (FunctO Pair (->) g) 
(CategoryO ~> a, CategoryO ~> b) => FunctorA (Id ~>) a b 
(CategoryO ~> a, CategoryO ~> b, CategoryA ~> x a b) => FunctorA (:*-: x ~>) a b 
(Cod h ~ Dom g, FunctorA g (F h a) (F h b), FunctorA h a b) => FunctorA (:.: g h) a b 
(CategoryO ~> a, CategoryO ~> b) => FunctorA (Diag (->) ~>) a b 
(CategoryO ~> a, CategoryO ~> b) => FunctorA (Diag Void ~>) a b 
(CategoryO ~> a, CategoryO ~> b) => FunctorA (Diag Pair ~>) a b 
(Dom m ~ (->), Cod m ~ (->), Monad m, FunctorA m a (F m b)) => FunctorA (KleisliAdjG (->) m) a b 
(Dom m ~ (->), Cod m ~ (->), Monad m) => FunctorA (KleisliAdjF (->) m) a b 
(CategoryO c1 a, CategoryO c1 b, CategoryO c2 x) => FunctorA (Const c1 c2 x) a b 
CategoryO ~> y => FunctorA (PairF ~> x y) Snd Snd 
CategoryO ~> x => FunctorA (PairF ~> x y) Fst Fst 
CategoryO ~> z => FunctorA (OmegaF ~> z f) Z Z 

class (CategoryO (Dom ftag) a, CategoryO (Dom ftag) b) => ContraFunctorA ftag a b whereSource

The mapping of arrows by contravariant functors.

Methods

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

Instances

(CategoryO ~> a, CategoryO ~> b, CategoryA ~> a b x) => ContraFunctorA (:-*: ~> x) a b 

Functor instances

data Id (~>) Source

The identity functor on (~>)

Constructors

Id 

Instances

(CategoryO ~> a, CategoryO ~> b) => FunctorA (Id ~>) a b 

data g :.: h Source

The composition of two functors.

Constructors

g :.: h 

Instances

(Dom m ~ (->), Cod m ~ (->), Pointed m) => Pointed (:.: (KleisliAdjG (->) m) (KleisliAdjF (->) m)) 
(Cod h ~ Dom g, FunctorA g (F h a) (F h b), FunctorA h a b) => FunctorA (:.: g h) a b 

data Const c1 c2 x Source

The constant functor.

Constructors

Const 

Instances

(CategoryO c1 a, CategoryO c1 b, CategoryO c2 x) => FunctorA (Const c1 c2 x) a b 

data x :*-: (~>) Source

The covariant functor Hom(X,--)

Constructors

HomX_ 

Instances

(CategoryO ~> a, CategoryO ~> b, CategoryA ~> x a b) => FunctorA (:*-: x ~>) a b 

data (~>) :-*: x Source

The contravariant functor Hom(--,X)

Constructors

Hom_X 

Instances

(CategoryO ~> a, CategoryO ~> b, CategoryA ~> a b x) => ContraFunctorA (:-*: ~> x) a b