Revisiting catamorphisms over datatypes with embedded functions (or, programs from outer space)
Revisiting catamorphisms over datatypes with embedded functions (or, programs from outer space)
复制标题
重新审视具有嵌入式函数(或来自外太空的程序)的数据类型的变形
DOI:
--
复制
发表时间:
1996
期刊:
影响因子:
--
通讯作者:
T. Sheard
中科院分区:
文献类型:
--
作者:
L. Fegaras;T. Sheard
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.