is an object of together with a -morphism
In this sense F-algebras are dual to F-coalgebras.
A homomorphism from -algebra to -algebra is a morphism
in such that
Thus the -algebras constitute a category.
Consider the functor that sends a set to . Here, Set denotes the category of sets, denotes the usual coproduct given by disjoint union, and 1 is a terminal object (i.e. any singleton set). Then the set of natural numbers together with the function , which is the coproduct of the functions (whose image is 0) and (which sends an integer n to n+1), is an -algebra.
If the category of -algebras for a given endofunctor F has an initial object, it is called an initial algebra. The algebra in the above example is an initial algebra. Various finite data structures used in programming, such as lists and trees, can be obtained as initial algebras of specific endofunctors.
See also Universal algebra.
In a dual way, similar relationship exists between notions of greatest fixed point and terminal F-coalgebra, these can be used for allowing potentially infinite objects while maintaining strong normalization property. In the strongly normalizing Charity programming language (i.e. each program terminates in it), coinductive data types can be used achieving surprising results, e.g. defining lookup constructs to implement such “strong” functions like the Ackermann function.