1996 · 101 citations · 9 references
ComputingComputer ScienceAlgorithmsFormal MethodsProgramming LanguagesAbstract Syntax TreesData TypesFunctional ProgrammingRecursion TheoryType CheckingType SystemsData Type InferenceDatatypes TheoryPolymorphic Type SystemsPolymorphic TypesRecursive TypesType Inference
We revisit the work of Paterson and of Meijer & Hutton, which describes how to construct catamorphisms for recursive datatype definitions that embed contravariant occurrences of the type being defined. Their construction requires, for each catamorphism, the definition of an anamorphism that has an inverse-like relationship to that catamorphism. We present an alternative construction, which replaces the stringent requirement that an inverse anamorphism be defined for each catamorphism with a more lenient restriction. The resulting construction has a more efficient implementation than that of Paterson, Meijer, and Hutton and the relevant restriction can be enforced by a Hindley-Milner type inference algorithm. We provide numerous examples illustrating our method.
9
A formulation of the simple theory of types
Alonzo Church · Journal of Symbolic Logic · 1940 · 1.9K citations
Philip Wadler · 1989 · 776 citations
Frank Pfenning, Conal Elliott · ACM SIGPLAN Notices · 1988 · 587 citations · Full text
Data structures and program transformation
Grant Malcolm · Science of Computer Programming · 1990 · 171 citations
Tim Sheard, Leonidas Fegaras · 1993 · 120 citations · Full text