Results 1 
1 of
1
Revisiting Catamorphisms over Datatypes with Embedded Functions (or, Programs from Outer Space)
 In Conf. Record 23rd ACM SIGPLAN/SIGACT Symp. on Principles of Programming Languages, POPLâ€™96, St. Petersburg Beach
, 1996
"... 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 i ..."
Abstract

Cited by 54 (3 self)
 Add to MetaCart
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 inverselike 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 HindleyMilner type inference algorithm. We provide numerous examples illustrating our method. 1 Introduction Functional programmers often use catamorphisms (or fold functions) as an elegant means of expressing algorithms over algebraic datatypes. Catamorphisms have also been used by functional programmers as a medium in ...