Portability | non-portable (class-associated types) |
---|---|

Stability | experimental |

Maintainer | Edward Kmett <ekmett@gmail.com> |

- class (Associative ~> (Product ~>), Disassociative ~> (Product ~>), Symmetric ~> (Product ~>), Braided ~> (Product ~>)) => PreCartesian (~>) where
- bimapProduct :: (PreCartesian ~>, <*> ~ Product ~>) => (a ~> c) -> (b ~> d) -> (a <*> b) ~> (c <*> d)
- braidProduct :: PreCartesian ~> => Product ~> a b ~> Product ~> b a
- associateProduct :: PreCartesian ~> => Product ~> (Product ~> a b) c ~> Product ~> a (Product ~> b c)
- disassociateProduct :: PreCartesian ~> => Product ~> a (Product ~> b c) ~> Product ~> (Product ~> a b) c
- class (Associative ~> (Sum ~>), Disassociative ~> (Sum ~>), Symmetric ~> (Product ~>), Braided ~> (Sum ~>)) => PreCoCartesian (~>) where
- bimapSum :: (PreCoCartesian ~>, Sum ~> ~ +) => (a ~> c) -> (b ~> d) -> (a + b) ~> (c + d)
- braidSum :: (PreCoCartesian ~>, + ~ Sum ~>) => (a + b) ~> (b + a)
- associateSum :: PreCoCartesian ~> => Sum ~> (Sum ~> a b) c ~> Sum ~> a (Sum ~> b c)
- disassociateSum :: PreCoCartesian ~> => Sum ~> a (Sum ~> b c) ~> Sum ~> (Sum ~> a b) c
- class (Monoidal ~> (Product ~>), PreCartesian ~>) => Cartesian (~>)
- class (Comonoidal ~> (Sum ~>), PreCoCartesian ~>) => CoCartesian (~>)

# 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, (&&&)

PreCartesian (->) |

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

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

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

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

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

PreCoCartesian (->) |

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

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

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

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

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

(Comonoidal ~> (Sum ~>), PreCoCartesian ~>) => CoCartesian ~> |