category-extras-0.53.0: Various modules and constructs inspired by category theory

Portabilitynon-portable (class-associated types)
Stabilityexperimental
MaintainerEdward Kmett <ekmett@gmail.com>

Control.Category.Cartesian

Contents

Description

 

Synopsis

Documentation

Pre-(Co)Cartesian categories

class (Associative k p, Coassociative k p, Braided k p) => PreCartesian k p | k -> p whereSource

NB: This is weaker than traditional category with products! That is Cartesian, below. The problem is (->) lacks an initial object, since every type is inhabited in Haskell. Consequently its coproduct is merely a semigroup, not a monoid as it has no identity, and since we want to be able to describe its dual category, which has this non-traditional form being built over a category with an associative bifunctor rather than as a monoidal category for the product monoid.

Minimum definition:

 fst, snd, diag 
 fst, snd, (&&&)

Methods

fst :: k (p a b) aSource

snd :: k (p a b) bSource

diag :: k a (p a a)Source

(&&&) :: k a b -> k a c -> k a (p b c)Source

Instances

bimapPreCartesian :: PreCartesian k p => k a c -> k b d -> k (p a b) (p c d)Source

free construction of Bifunctor for the product Bifunctor Prod k if (&&&) is known

braidPreCartesian :: PreCartesian k p => k (p a b) (p b a)Source

free construction of Braided for the product Bifunctor Prod k

associatePreCartesian :: PreCartesian k p => k (p (p a b) c) (p a (p b c))Source

free construction of Associative for the product Bifunctor Prod k

coassociatePreCartesian :: PreCartesian k p => k (p a (p b c)) (p (p a b) c)Source

free construction of Coassociative for the product Bifunctor Prod k

class (Associative k s, Coassociative k s, Braided k s) => PreCoCartesian k s | k -> s whereSource

Methods

inl :: k a (s a b)Source

inr :: k b (s a b)Source

codiag :: k (s a a) aSource

(|||) :: k a c -> k b c -> k (s a b) cSource

bimapPreCoCartesian :: PreCoCartesian k s => k a c -> k b d -> k (s a b) (s c d)Source

free construction of Bifunctor for the coproduct Bifunctor Sum k if (|||) is known

braidPreCoCartesian :: PreCoCartesian k s => k (s a b) (s b a)Source

free construction of Braided for the coproduct Bifunctor Sum k

associatePreCoCartesian :: PreCoCartesian k s => k (s (s a b) c) (s a (s b c))Source

free construction of Associative for the coproduct Bifunctor Sum k

coassociatePreCoCartesian :: PreCoCartesian k s => k (s a (s b c)) (s (s a b) c)Source

free construction of Coassociative for the coproduct Bifunctor Sum k

(Co)Cartesian categories

class (Monoidal k p i, PreCartesian k p) => Cartesian k p i | k -> p iSource

Instances

(Monoidal k p i, PreCartesian k p) => Cartesian k p i 

class (Comonoidal k s i, PreCoCartesian k s) => CoCartesian k s i | k -> s iSource

Instances

(Comonoidal k s i, PreCoCartesian k s) => CoCartesian k s i