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

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

Control.Category.Cartesian.Closed

Contents

Description

NB: Some rewrite rules are disabled pending resolution of: http://hackage.haskell.org/trac/ghc/ticket/2291

Synopsis

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