Generalized iteration and coiteration for higher-order nested datatypes

  • Authors:
  • Andreas Abel;Ralph Matthes;Tarmo Uustalu

  • Affiliations:
  • Department of Computer Science, University of Munich;CNRS, Université Paris VII;Inst. of Cybernetics, Tallinn Technical University

  • Venue:
  • FOSSACS'03/ETAPS'03 Proceedings of the 6th International conference on Foundations of Software Science and Computation Structures and joint European conference on Theory and practice of software
  • Year:
  • 2003

Quantified Score

Hi-index 0.00

Visualization

Abstract

We solve the problem of extending Bird and Paterson's generalized folds for nested datatypes and its dual to inductive and coinductive constructors of arbitrarily high ranks by appropriately generalizing Mendler-style (co)iteration. Characteristically to Mendler-style schemes of disciplined (co)recursion, the schemes we propose do not rest on notions like positivity or monotonicity of a constructor and facilitate programming in a natural and elegant style close to programming with the customary letrec construct, where the typings of the schemes, however, guarantee termination. For rank 2, a smoothened version of Bird and Paterson's generalized folds and its dual are achieved; for rank 1, the schemes instantiate to Mendler's original (re)formulation of iteration and coiteration. Several examples demonstrate the power of the approach. Strong normalization of our proposed extension of system Fω of higher-order parametric polymorphism is proven by a reduction-preserving embedding into pure Fω.