- Anamorphism
Anamorphism is a concept from
functional programming grounded incategory theory . The term comes from Greek Polytonic|ανα- (upwards) +morphism (from Greek Polytonic|μορφή, 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 type s that can be described asfinal coalgebra s. Unfolds are theco-recursive analogues ofrecursive 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", 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 ofcatamorphism s.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
*
Catamorphism
* Hylomorphism
*Paramorphism
*Apomorphism External links
* Erik Meijer, Maarten Fokkinga, and Ross Paterson. "Functional Programming with Bananas, Lenses, Envelopes, and Barbed Wire" [http://research.microsoft.com/~emeijer/Papers/fpca91.pdf] , contains additional definitions and examples
Wikimedia Foundation. 2010.