📑 Table of Contents

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[1] to deal with a form which “eats its argument and keeps it too”,[2][3] 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

edit

References

edit
  1. ^ "Paramorphisms" (PDF). 1990. p. 44. CiteSeerX 10.1.1.19.4825.
  2. ^ Philip Wadler.Views: A way for pattern matching to cohabit with data abstraction. Technical Report 34, Programming Methodology Group, University of Gothenburg and Chalmers University of Technology, March 1987.
  3. ^ Meijer, Erik; Fokkinga, Maarten; Paterson, Ross (1991). "Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire". CiteSeerX 10.1.1.41.125. {{cite web}}: Missing or empty |url= (help)
edit


📚 Artikel Terkait di Wikipedia

Pseudomorph

as occurs at the Corocoro United Copper Mines of Coro Coro, Bolivia. A paramorph (also called allomorph) is a mineral changed on the molecular level only

Apomorphism

the categorical dual of a paramorphism and an extension of the concept of anamorphism (coinduction). Whereas a paramorphism models primitive recursion

Volcanic rock

unstable at a certain stage of consolidation, and has been replaced by a paramorph of augite and magnetite, which may partially or completely substitute

List of Greek and Latin roots in English/H–O

morpheme, Morpheus, morphine, morphology, morphosyntactic, morphosyntax, paramorph, peramorphism, peramorphosis, perimorph, plesiomorphy, polymorphic, polymorphism

Vivianite

species, metavivianite Fe2+2Fe3+(PO4)2(OH)·7H2O, which usually occurs as paramorphs after vivianite. As pigment, vivianite is known as "blue ochre" and has

Catamorphism

an catamorphism: Hylomorphism Extension of the idea of catamorphisms: Paramorphism Extension of the idea of anamorphisms: Apomorphism Meijer, Erik; Fokkinga

Hylomorphism (computer science)

final coalgebra: Anamorphism Extension of the idea of catamorphisms: Paramorphism Extension of the idea of anamorphisms: Apomorphism Erik Meijer; Maarten

Anamorphism

an catamorphism: Hylomorphism Extension of the idea of catamorphisms: Paramorphism Extension of the idea of anamorphisms: Apomorphism Meijer, Erik; Fokkinga