Jump to content

Anamorphism

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by 88.234.217.196 (talk) at 18:38, 31 January 2009 (→‎Anamorphisms in functional programming: Resolving a red link). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Template:Otheruses2 Anamorphism is a concept from functional programming grounded in category theory. The term comes from Greek ανα- (upwards) + morphism (from Greek μορφή, or form, shape).

Anamorphisms in functional programming

In functional programming, an anamorphism is a generalization of the list-producing unfolds known from functional programming to arbitrary abstract data types that can be described as final coalgebras. Unfolds are the co-recursive analogues of recursive folds.

One of the first publications to introduce the notion of an anamorphism in the context of programming was the paper Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire,[1] by Erik Meijer et al., which was in the context of the Squiggol programming language.

Anamorphisms in category theory

In category theory, anamorphisms are the categorical dual of catamorphisms.

Notation

A notation for ana f found in the literature is . The brackets used are known as lens brackets, after which anamorphisms are sometimes referred to as lenses.

See also

References

  1. ^ Meijer, Erik (1991). "Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire". {{cite web}}: Unknown parameter |coauthors= ignored (|author= suggested) (help)