Sciweavers

FPCA
1995

Bananas in Space: Extending Fold and Unfold to Exponential Types

13 years 7 months ago
Bananas in Space: Extending Fold and Unfold to Exponential Types
Fold and unfold are general purpose functionals for processing and constructing lists. By using the categorical approach of modelling recursive datatypes as fixed points of functors, these functionals and their algebraic properties were generalised from lists to polynomial (sum-of-product) datatypes. However, the restriction to polynomial datatypes is a serious limitation: it precludes the use of exponentials (functionspaces), whereas it is central to functional programming that functions are first-class values, and so exponentials should be able to be used freely in datatype definitions. In this paper we explain how Freyd’s work on modelling recursive datatypes as fixed points of difunctors shows how to generalise fold and unfold from polynomial datatypes to those involving exponentials. Knowledge of category theory is not required; we use Gofer throughout as our meta-language, making extensive use of constructor classes.
Erik Meijer, Graham Hutton
Added 26 Aug 2010
Updated 26 Aug 2010
Type Conference
Year 1995
Where FPCA
Authors Erik Meijer, Graham Hutton
Comments (0)