semi-iso-1.0.0.0: Weakened partial isomorphisms, reversible computations.

Copyright(c) Paweł Nowak
LicenseMIT
MaintainerPaweł Nowak <pawel834@gmail.com>
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Category.Structures

Description

This module defines some basic structures in a category in a more fine-grained way then Control.Arrow.

Unfortunately names in this module clash with Control.Arrow.

Synopsis

Documentation

class Category cat => Products cat where Source

A category with finite products.

Minimal complete definition

(***) | first, second

Methods

first :: cat a b -> cat (a, c) (b, c) Source

Send the first component of the input through the argument arrow, and copy the rest unchanged to the output.

first a is equal to a *** id.

second :: cat a b -> cat (c, a) (c, b) Source

A mirror image of first.

second a is equal to id *** a.

(***) :: cat a b -> cat c d -> cat (a, c) (b, d) infixl 3 Source

A product of two arrows. Split the input between the two argument arrows and combine their output.

Instances

class Category cat => Coproducts cat where Source

A category with finite coproducts.

Minimal complete definition

(+++) | left, right

Methods

left :: cat a b -> cat (Either a c) (Either b c) Source

Feed marked inputs through the argument arrow, passing the rest through unchanged to the output.

left a is equal to a +++ id.

right :: cat a b -> cat (Either c a) (Either c b) Source

A mirror image of left.

right a is equal to id +++ a.

(+++) :: cat a b -> cat c d -> cat (Either a c) (Either b d) infixl 2 Source

A coproduct of two arrows. Split the input between the two argument arrows, retagging and merging their outputs.

class Category cat => CatPlus cat where Source

A category cat is a CatPlus when cat a b is a monoid for all a, b.

Methods

cempty :: cat a b Source

The identity of /+/.

(/+/) :: cat a b -> cat a b -> cat a b infixl 3 Source

An associative operation on arrows.

Instances

class CatTrans t where Source

A category transformer.

Methods

clift :: Category cat => cat a b -> t cat a b Source

Lift an arrow from the base category.

Instances