categories-1.0.2: Categories

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

Control.Category.Cartesian

Contents

Description

 

Synopsis

(Co)Cartesian categories

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

Minimum definition:

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

Associated Types

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

Methods

fst :: Product k a b `k` aSource

snd :: Product k a b `k` bSource

diag :: a `k` Product k a aSource

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

Instances

Cartesian (->) 

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

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 => Product k (Product k a b) c `k` Product k a (Product k b c)Source

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) cSource

free construction of Disassociative for the product Bifunctor Product k

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

Associated Types

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

Methods

inl :: a `k` Sum k a bSource

inr :: b `k` Sum k a bSource

codiag :: Sum k a a `k` aSource

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

Instances

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

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

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

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)Source

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) cSource

free construction of Disassociative for the coproduct Bifunctor Sum k