Disciplined, efficient, generalised folds for nested datatypes

  • Authors:
  • Clare Martin;Jeremy Gibbons;Ian Bayley

  • Affiliations:
  • Oxford Brookes University, School of Computing and Mathematical Sciences, UK;Oxford University Computing Laboratory, School of Computing and Mathematical Sciences, UK;Oxford University Computing Laboratory, School of Computing and Mathematical Sciences, UK

  • Venue:
  • Formal Aspects of Computing
  • Year:
  • 2004

Quantified Score

Hi-index 0.01

Visualization

Abstract

Nested (or non-uniform, or non-regular) datatypes have recursive definitions in which the type parameter changes. Their folds are restricted in power due to type constraints. Bird and Paterson introduced generalised folds for extra power, but at the cost of a loss of efficiency: folds may take more than linear time to evaluate. Hinze introduced efficient generalised folds to counter this inefficiency, but did so in a pragmatic way: he did not provide categorical or equivalent underpinnings, so did not get the associated universal properties for manipulating folds. We combine the efficiency of Hinze’s construction with the powerful reasoning tools of Bird and Paterson’s.