categories-0.54.0: categories from category-extras

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

Control.Category.Cartesian

Contents

Description

 

Synopsis

Pre-(Co)Cartesian categories

class (Associative ~> (Product ~>), Disassociative ~> (Product ~>), Symmetric ~> (Product ~>), Braided ~> (Product ~>)) => PreCartesian (~>) 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, (&&&)

Associated Types

type Product (~>) :: * -> * -> *Source

Methods

fst :: Product ~> a b ~> aSource

snd :: Product ~> a b ~> bSource

diag :: a ~> Product ~> a aSource

(&&&) :: (a ~> b) -> (a ~> c) -> a ~> Product ~> b cSource

Instances

bimapProduct :: (PreCartesian ~>, <*> ~ Product ~>) => (a ~> c) -> (b ~> d) -> (a <*> b) ~> (c <*> d)Source

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

braidProduct :: PreCartesian ~> => Product ~> a b ~> Product ~> b aSource

free construction of Braided for the product Bifunctor Product k braidProduct :: (PreCartesian (~>), Product (~>) ~ (*)) => a * b ~> b * a

associateProduct :: PreCartesian ~> => Product ~> (Product ~> a b) c ~> Product ~> a (Product ~> b c)Source

free construction of Associative for the product Bifunctor Product k associateProduct :: (PreCartesian (~>), (*) ~ Product (~>)) => (a * b) * c ~> (a * (b * c))

disassociateProduct :: PreCartesian ~> => Product ~> a (Product ~> b c) ~> Product ~> (Product ~> a b) cSource

free construction of Disassociative for the product Bifunctor Product k disassociateProduct:: (PreCartesian (~>), (*) ~ Product (~>)) => a * (b * c) ~> (a * b) * c

class (Associative ~> (Sum ~>), Disassociative ~> (Sum ~>), Symmetric ~> (Product ~>), Braided ~> (Sum ~>)) => PreCoCartesian (~>) whereSource

Associated Types

type Sum (~>) :: * -> * -> *Source

Methods

inl :: a ~> Sum ~> a bSource

inr :: b ~> Sum ~> a bSource

codiag :: Sum ~> a a ~> aSource

(|||) :: (a ~> c) -> (b ~> c) -> Sum ~> a b ~> cSource

Instances

bimapSum :: (PreCoCartesian ~>, Sum ~> ~ +) => (a ~> c) -> (b ~> d) -> (a + b) ~> (c + d)Source

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

braidSum :: (PreCoCartesian ~>, + ~ Sum ~>) => (a + b) ~> (b + a)Source

free construction of Braided for the coproduct Bifunctor Sum (~>)

associateSum :: PreCoCartesian ~> => Sum ~> (Sum ~> a b) c ~> Sum ~> a (Sum ~> b c)Source

free construction of Associative for the coproduct Bifunctor Sum (~>) associateSum :: (PreCoCartesian (~>), (+) ~ Sum (~>)) => ((a + b) + c) ~> (a + (b + c))

disassociateSum :: PreCoCartesian ~> => Sum ~> a (Sum ~> b c) ~> Sum ~> (Sum ~> a b) cSource

free construction of Disassociative for the coproduct Bifunctor Sum (~>) disassociateSum :: (PreCoCartesian (~>), (+) ~ Sum (~>)) => (a + (b + c)) ~> ((a + b) + c)

(Co)Cartesian categories

class (Monoidal ~> (Product ~>), PreCartesian ~>) => Cartesian (~>) Source

Instances

(Monoidal ~> (Product ~>), PreCartesian ~>) => Cartesian ~> 

class (Comonoidal ~> (Sum ~>), PreCoCartesian ~>) => CoCartesian (~>) Source

Instances