categories-1.0.7: Categories

Copyright | 2008-2010 Edward Kmett
License | BSD
Maintainer | Edward Kmett <ekmett@gmail.com>
Stability | experimental
Portability | non-portable (class-associated types)
Safe Haskell | Trustworthy
Language | Haskell2010

Control.Category.Cartesian

Contents

- (Co)Cartesian categories

Description

Synopsis

- class (Symmetric k (Product k), Monoidal k (Product k)) => Cartesian (k :: Type -> Type -> Type) where
  - type Product (k :: Type -> Type -> Type) :: Type -> Type -> Type
  - fst :: k (Product k a b) a
  - snd :: k (Product k a b) b
  - diag :: k a (Product k a a)
  - (&&&) :: k a b -> k a c -> k a (Product k b c)
- bimapProduct :: Cartesian k => k a c -> k b d -> k (Product k a b) (Product k c d)
- braidProduct :: Cartesian k => k (Product k a b) (Product k b a)
- associateProduct :: Cartesian k => k (Product k (Product k a b) c) (Product k a (Product k b c))
- disassociateProduct :: Cartesian k => k (Product k a (Product k b c)) (Product k (Product k a b) c)
- class (Monoidal k (Sum k), Symmetric k (Sum k)) => CoCartesian (k :: Type -> Type -> Type) where
  - type Sum (k :: Type -> Type -> Type) :: Type -> Type -> Type
  - inl :: k a (Sum k a b)
  - inr :: k b (Sum k a b)
  - codiag :: k (Sum k a a) a
  - (|||) :: k a c -> k b c -> k (Sum k a b) c
- bimapSum :: CoCartesian k => k a c -> k b d -> k (Sum k a b) (Sum k c d)
- braidSum :: CoCartesian k => k (Sum k a b) (Sum k b a)
- associateSum :: CoCartesian k => k (Sum k (Sum k a b) c) (Sum k a (Sum k b c))
- disassociateSum :: CoCartesian k => k (Sum k a (Sum k b c)) (Sum k (Sum k a b) c)

# (Co)Cartesian categories

class (Symmetric k (Product k), Monoidal k (Product k)) => Cartesian (k :: Type -> Type -> Type) where Source #

Minimum definition:

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

Minimal complete definition

fst, snd

Associated Types

type Product (k :: Type -> Type -> Type) :: Type -> Type -> Type Source #

Methods

fst :: k (Product k a b) a Source #

snd :: k (Product k a b) b Source #

diag :: k a (Product k a a) Source #

(&&&) :: k a b -> k a c -> k a (Product k b c) infixr 3 Source #

#### Instances

Instances details

Cartesian (->) Source # |

Instance details

Defined in Control.Category.Cartesian

Associated Types

type Product (->) |
Instance details Defined in Control.Category.Cartesian type Product (->) = (,)

Methods

fst :: Product (->) a b -> a Source #

snd :: Product (->) a b -> b Source #

diag :: a -> Product (->) a a Source #

(&&&) :: (a -> b) -> (a -> c) -> a -> Product (->) b c Source #

bimapProduct :: Cartesian k => k a c -> k b d -> k (Product k a b) (Product k c d) Source #

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

braidProduct :: Cartesian k => k (Product k a b) (Product k b a) Source #

free construction of `Braided` for the product `Bifunctor` `Product k`

associateProduct :: Cartesian k => k (Product k (Product k a b) c) (Product k a (Product k b c)) Source #

free construction of `Associative` for the product `Bifunctor` `Product k`

disassociateProduct :: Cartesian k => k (Product k a (Product k b c)) (Product k (Product k a b) c) Source #

free construction of `Disassociative` for the product `Bifunctor` `Product k`

class (Monoidal k (Sum k), Symmetric k (Sum k)) => CoCartesian (k :: Type -> Type -> Type) where Source #

Minimal complete definition

inl, inr

Associated Types

type Sum (k :: Type -> Type -> Type) :: Type -> Type -> Type Source #

Methods

inl :: k a (Sum k a b) Source #

inr :: k b (Sum k a b) Source #

codiag :: k (Sum k a a) a Source #

(|||) :: k a c -> k b c -> k (Sum k a b) c infixr 2 Source #

#### Instances

Instances details

CoCartesian (->) Source # |

Instance details

Defined in Control.Category.Cartesian

Associated Types

type Sum (->) |
Instance details Defined in Control.Category.Cartesian type Sum (->) = Either

Methods

inl :: a -> Sum (->) a b Source #

inr :: b -> Sum (->) a b Source #

codiag :: Sum (->) a a -> a Source #

(|||) :: (a -> c) -> (b -> c) -> Sum (->) a b -> c Source #

bimapSum :: CoCartesian k => k a c -> k b d -> k (Sum k a b) (Sum k c d) Source #

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

braidSum :: CoCartesian k => k (Sum k a b) (Sum k b a) Source #

free construction of `Braided` for the coproduct `Bifunctor` `Sum k`

associateSum :: CoCartesian k => k (Sum k (Sum k a b) c) (Sum k a (Sum k b c)) Source #

free construction of `Associative` for the coproduct `Bifunctor` `Sum k`

disassociateSum :: CoCartesian k => k (Sum k a (Sum k b c)) (Sum k (Sum k a b) c) Source #

free construction of `Disassociative` for the coproduct `Bifunctor` `Sum k`