Monad (category theory)

A monad is in the mathematical branch of category theory, a structure that has certain formal similarity with the monoids of algebra.

Definition

A monad is a triple of

  • A functor T of a category K into itself, ie,
  • A natural transformation ( stands for the Identitätsfunktor )
  • A natural transformation ( stands for )

So that the following conditions are met:

  • , I.e., the following diagram commutated:
  • , I.e., the following diagram commutated:

Explicitly means the commutativity of the diagrams that for each object in the two graphs

Commute. The first condition is analogous to the associative law at monoids, the second to the existence of a neutral element.

Algebras

Is a monad, so a pair is an ( Eilenberg -Moore ) algebra for this monad, if

  • And

. apply A homomorphism from to is an arrow in with.

Therefore, for example, for any target from an algebra, and is a homomorphism from to.

Examples

Dcpos

The Endofunktor on the category of partially ordered sets and monotone illustrations arrange all the partially ordered set of ideals in order to. Its effect on monotone illustrations is. For a partially ordered set and a subset is here.

The figure families and complement the functor to a monad.

The structure mapping of a - algebra is now straight. So Every ideal in ( and thus each directed subset ) has an upper bound in. That is, an algebra is the same as a DCPO. A homomorphism of algebras is a Scott - continuous map.

Adjoint functors

Is a functor linksadjungiert to a functor, and are

Unit or Koeinheit the adjunction, then with

  • Thus, for objects

A monad.

This is in some sense about the only example since every monad arises in this way, at least up to isomorphism: the triples with, and are objects of a category. In this category, a morphism is a functor by, for and apply.

Initial object is in, where the Kleisli category is closed. For is. For is.

Final object is in the category of Eilenberg -Moore algebras is. For is. .

Lists

An example of a monad are lists. If the list of the items referred to, then provides the following triples a monad on the category of sets is:

  • In the object plane yields the set of all lists whose elements come from, for any amount.
  • For a mapping between two quantities yields the corresponding mapping between the list with quantities

The statements of the axioms can be accordingly transferred to the list Example:

This is part of a monad adjoint Funktorpaar (as above) between the categories of quantities or semigroups. assigns a lot of the free semigroup on this lot to a semigroup the amount underlying.

Application

Monads are in computer science, particularly in functional programming languages ​​among others used for the abstraction of side effects. It should be emphasized Haskell, monads where the integration of input and output are used in the otherwise completely free of side effects language. See also Monad ( computer science ).

579255
de