category-extras-0.53.6: Various modules and constructs inspired by category theoryContentsIndex
Control.Category.Monoidal
Portabilitynon-portable (class-associated types)
Stabilityexperimental
MaintainerEdward Kmett <ekmett@gmail.com>
Description
A Monoidal category is a category with an associated biendofunctor that has an identity, which satisfies Mac Lane''s pentagonal and triangular coherence conditions Technically we usually say that category is monoidal, but since most interesting categories in our world have multiple candidate bifunctors that you can use to enrich their structure, we choose here to think of the bifunctor as being monoidal. This lets us reuse the same Bifunctor over different categories without painful type annotations.
Synopsis
module Control.Category.Braided
class Bifunctor p k k k => HasIdentity k p i | k p -> i
class (Associative k p, HasIdentity k p i) => Monoidal k p i | k p -> i where
idl :: k (p i a) a
idr :: k (p a i) a
class (Coassociative k p, HasIdentity k p i) => Comonoidal k p i | k p -> i where
coidl :: k a (p i a)
coidr :: k a (p a i)
Documentation
module Control.Category.Braided
class Bifunctor p k k k => HasIdentity k p i | k p -> i
Denotes that we have some reasonable notion of Identity for a particular Bifunctor in this Category. This notion is currently used by both Monoidal and Comonoidal
show/hide Instances
class (Associative k p, HasIdentity k p i) => Monoidal k p i | k p -> i where

A monoidal category. idl and idr are traditionally denoted lambda and rho the triangle identity holds:

 bimap idr id = bimap id idl . associate 
 bimap id idl = bimap idr id . associate
Methods
idl :: k (p i a) a
idr :: k (p a i) a
show/hide Instances
class (Coassociative k p, HasIdentity k p i) => Comonoidal k p i | k p -> i where

A comonoidal category satisfies the dual form of the triangle identities

 bimap idr id = coassociate . bimap id idl
 bimap id idl = coassociate . bimap idr id

This type class is also (ab)used for the inverse operations needed for a strict (co)monoidal category. A strict (co)monoidal category is one that is both Monoidal and Comonoidal and satisfies the following laws:

 idr . coidr = id 
 idl . coidl = id 
 coidl . idl = id 
 coidr . idr = id 
Methods
coidl :: k a (p i a)
coidr :: k a (p a i)
show/hide Instances
Produced by Haddock version 2.1.0