categories-1.0.5: Categories

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

Control.Category.Cartesian

Contents

Description

 

Synopsis

(Co)Cartesian categories

class (Symmetric k (Product k), Monoidal k (Product k)) => Cartesian k where

Minimum definition:

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

Associated Types

type Product k :: * -> * -> *

Methods

fst :: Product k a b `k` a

snd :: Product k a b `k` b

diag :: a `k` Product k a a

(&&&) :: (a `k` b) -> (a `k` c) -> a `k` Product k b c

Instances

Cartesian (->) 

bimapProduct :: Cartesian k => k a c -> k b d -> Product k a b `k` Product k c d

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)

free construction of Braided for the product Bifunctor Product k

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

free construction of Associative for the product Bifunctor Product k

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

free construction of Disassociative for the product Bifunctor Product k

class (Monoidal k (Sum k), Symmetric k (Sum k)) => CoCartesian k where

Associated Types

type Sum k :: * -> * -> *

Methods

inl :: a `k` Sum k a b

inr :: b `k` Sum k a b

codiag :: Sum k a a `k` a

(|||) :: k a c -> k b c -> Sum k a b `k` c

Instances

bimapSum :: CoCartesian k => k a c -> k b d -> Sum k a b `k` Sum k c d

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

braidSum :: CoCartesian k => Sum k a b `k` Sum k b a

free construction of Braided for the coproduct Bifunctor Sum k

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

free construction of Associative for the coproduct Bifunctor Sum k

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

free construction of Disassociative for the coproduct Bifunctor Sum k