category-extras-0.51.3: Various modules and constructs inspired by category theory

Portability non-portable (class-associated types) experimental Edward Kmett

Control.Category.Cartesian.Closed

Description

NB: Some rewrite rules are disabled pending resolution of: http://hachomage.hashomell.org/trac/ghc/tichomet/2291

Synopsis

• class (Monoidal hom prod i, Cartesian hom prod i) => CCC hom prod exp i | hom -> prod exp i where
• apply :: hom (prod (exp a b) a) b
• curry :: hom (prod a b) c -> hom a (exp b c)
• uncurry :: hom a (exp b c) -> hom (prod a b) c
• unitCCC :: CCC hom prod exp i => hom a (exp b (prod b a))
• counitCCC :: CCC hom prod exp i => hom (prod b (exp b a)) a
• class (Comonoidal hom sum i, CoCartesian hom sum i) => CoCCC hom sum coexp i | hom -> sum coexp i where
• coapply :: hom b (sum (coexp hom a b) a)
• cocurry :: hom c (sum a b) -> hom (coexp hom b c) a
• uncocurry :: hom (coexp hom b c) a -> hom c (sum a b)
• unitCoCCC :: CoCCC hom sum coexp i => hom a (sum b (coexp hom b a))
• counitCoCCC :: CoCCC hom sum coexp i => hom (coexp hom b (sum b a)) a

# Cartesian Closed Category

class (Monoidal hom prod i, Cartesian hom prod i) => CCC hom prod exp i | hom -> prod exp i whereSource

A `CCC` has full-fledged monoidal finite products and exponentials

Methods

apply :: hom (prod (exp a b) a) bSource

curry :: hom (prod a b) c -> hom a (exp b c)Source

uncurry :: hom a (exp b c) -> hom (prod a b) cSource

unitCCC :: CCC hom prod exp i => hom a (exp b (prod b a))Source

counitCCC :: CCC hom prod exp i => hom (prod b (exp b a)) aSource

# Co-(Cartesian Closed Category)

class (Comonoidal hom sum i, CoCartesian hom sum i) => CoCCC hom sum coexp i | hom -> sum coexp i whereSource

A Co-CCC has full-fledged comonoidal finite coproducts and coexponentials

Methods

coapply :: hom b (sum (coexp hom a b) a)Source

cocurry :: hom c (sum a b) -> hom (coexp hom b c) aSource

uncocurry :: hom (coexp hom b c) a -> hom c (sum a b)Source

unitCoCCC :: CoCCC hom sum coexp i => hom a (sum b (coexp hom b a))Source

counitCoCCC :: CoCCC hom sum coexp i => hom (coexp hom b (sum b a)) aSource