encyclopegia.org

Paramorphism

In formal methods of computer science, a paramorphism (from Greek παρά, meaning "close together") is an extension of the concept of catamorphism first introduced by Lambert Meertens to deal with a form which “eats its argument and keeps it too”, as exemplified by the factorial function. Its categorical dual is the apomorphism. It is a more convenient version of catamorphism in that it gives the combining step function immediate access not only to the result value recursively computed from each recursive subobject, but the original subobject itself as well. Example Haskell implementation, for lists: cata :: (a -> b -> b) -> b -> [a] -> b para :: (a -> ([a], b) -> b) -> b -> [a] -> b ana :: (b -> (a, b)) -> b -> [a] apo :: (b -> (a, Either [a] b)) -> b -> [a] cata f b (a:as) = f a (cata f b as) cata _ b [] = b para f b (a:as) = f a (as, para f b as) para _ b [] = b ana u b = case u b of (a, b') -> a : ana u b' apo u b = case u b of (a, Right b') -> a : apo u b' (a, Left as) -> a : as

In formal methods of computer science, a paramorphism (from Greek παρά, meaning "close together") is an extension of the concept of catamorphism first introduced by Lambert Meertens to deal with a form which “eats its argument and keeps it too”, as exemplified by the factorial function. Its categorical dual is the apomorphism. It is a more convenient version of catamorphism in that it gives the combining step function immediate access not only to the result value recursively computed from each recursive subobject, but the original subobject itself as well. Example Haskell implementation, for lists: cata :: (a -> b -> b) -> b -> [a] -> b para :: (a -> ([a], b) -> b) -> b -> [a] -> b ana :: (b -> (a, b)) -> b -> [a] apo :: (b -> (a, Either [a] b)) -> b -> [a] cata f b (a:as) = f a (cata f b as) cata _ b [] = b para f b (a:as) = f a (as, para f b as) para _ b [] = b ana u b = case u b of (a, b') -> a : ana u b' apo u b = case u b of (a, Right b') -> a : apo u b' (a, Left as) -> a : as ==See also== Morphism Morphisms of F-algebras From an initial algebra to an algebra: Catamorphism From a coalgebra to a final coalgebra: Anamorphism An anamorphism followed by an catamorphism: Hylomorphism Extension of the idea of anamorphisms: Apomorphism ==References== Talks: * [https://hackage.haskell.org/package/recursion-schemes-5.0.1/docs/Data-Functor-Foldable.html Recursion schemes Haskell package

References

No reference rows published for this article.

Cite this article

MLA

"Paramorphism." encyclopegia.org, 2024, https://encyclopegia.org/wiki/paramorphism. Accessed 24 November 2026.

Chicago

"Paramorphism." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/paramorphism.

APA

encyclopegia.org. (2024). Paramorphism. Retrieved November 24, 2026, from https://encyclopegia.org/wiki/paramorphism

Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON

CC BY-SA 4.0 · share-alike · https://en.wikipedia.org/w/index.php?oldid=1249728862 · 0.5 · snapshot enwiki-001249728862

Cite · JSON · Search

Related services and records

Services

  • Estate — measured countries, lanes and facts
  • Intel — live corroborated events
  • Legal — statutes, cases and citations
  • Encyclopedia — articles with inline sources
  • Space — launches, satellites and orbits
  • Search — federated search and reports
  • Pass — passport account and SSO
  • Corpora — read-only corpus origins
  • e01 — self-hosted corpora and tools

Text and metadata only; each target carries its own sources. Missing data is published as no-data, never estimated.