data-category-0.6.1: Category theory

Portabilitynon-portable
Stabilityexperimental
Maintainersjoerd@w3future.com
Safe HaskellSafe-Inferred

Data.Category.Simplex

Contents

Description

The (augmented) simplex category.

Synopsis

Simplex Category

data Simplex whereSource

Constructors

Z :: Simplex Z Z 
Y :: Simplex x y -> Simplex x (S y) 
X :: Simplex x (S y) -> Simplex (S x) (S y) 

Instances

Category Simplex

The (augmented) simplex category is the category of finite ordinals and order preserving maps.

HasInitialObject Simplex

The ordinal 0 is the initial object of the simplex category.

HasTerminalObject Simplex

The ordinal 1 is the terminal object of the simplex category.

data Z Source

data S n Source

Functor

data Forget Source

Constructors

Forget 

Instances

Functor Forget

Turn Simplex x y arrows into Fin x -> Fin y functions.

data Fin whereSource

Constructors

Fz :: Fin (S n) 
Fs :: Fin n -> Fin (S n) 

data Add Source

Constructors

Add 

Instances

Functor Add

Ordinal addition is a bifuntor, it concattenates the maps as it were.

TensorProduct Add

Ordinal addition makes the simplex category a monoidal category, with 0 as unit.

The universal monoid

universalMonoid :: MonoidObject Add (S Z)Source

The maps 0 -> 1 and 2 -> 1 form a monoid, which is universal, c.f. Replicate.

data Replicate f a Source

Constructors

Replicate f (MonoidObject f a) 

Instances

TensorProduct f => Functor (Replicate f a)

Replicate a monoid a number of times.