Abstract
The problem of defining iteration for higher-order nested datatypes of arbitrary (finite) rank is solved within the framework of System Fω of higher-order parametric polymorphism. The proposed solution heavily relies on a general notion of monotonicity as opposed to a syntactic criterion on the shape of the type constructors such as positivity or even being polynomial. Its use is demonstrated for some rank-2 heterogeneous/nested datatypes such as powerlists and de Bruijn terms with explicit substitutions. An important feature is the availability of an iterative definition of the mapping operation (the functoriality)for those rank-1 type transformers (i. e., functions from types to types) arising as least fixed-points of monotone rank-2 type transformers. Strong normalization is shown by an embedding into Fω. The results dualize to greatest fixed-points, hence to coinductive constructors with coiteration.
The first author gratefully acknowledges the support by the PhD Programme Logic in Computer Science (GKLI) of the Deutsche Forschungs-Gemeinschaft.
The second author has benefitted from financial support by the EC ESPRIT project 21900 “TYPES” and the EU IST working group 29001 “TYPES”.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Andreas Abel. Haskell examples for iteration and coiteration on higher-order datatypes. Haskell code accompanying this article, available on the author’s homepage, 2003.
Thorsten Altenkirch. Representations of first order function types as terminal coalgebras. In Samson Abramsky, editor, Fifth International Conference on Typed Lambda Calculi and Applications, volume 2044 of Lecture Notes in Computer Science, pages 8–21. Springer, 2001.
Thorsten Altenkirch and Conor McBride. Generic programming within dependently typed programming. To appear in the proceedings of WCGP’02, 2002.
Thorsten Altenkirch and Bernhard Reus. Monadic presentations of lambda terms using generalized inductive types. In Jörg Flum and Mario Rodríguez-Artalejo, editors, Computer Science Logic, 13th International Workshop, CSL’ 99, Proceedings, volume 1683 of Lecture Notes in Computer Science, pages 453–468. Springer, 1999.
Henk P. Barendregt. Lambda calculi with types. In Samson Abramsky, Dov M. Gabbay, and Tom S. E. Maibaum, editors, Background: Computational Structures, volume 2 of Handbook of Logic in Computer Science, pages 117–309. 1992.
Wilfried Buchholz, Solomon Feferman, Wolfram Pohlers, and Wilfried Sieg. Iterated Inductive Definitions and Subsystems of Analysis: Recent Proof-Theoretical Studies, volume 897 of Lecture Notes in Mathematics. Springer Verlag, 1981.
Richard Bird, Jeremy Gibbons, and Geraint Jones. Program optimisation, naturally. In Millenial Perspectives in Computer Science, Palgrave, 2000.
Richard Bird and Lambert Meertens. Nested datatypes. In Johan Jeuring, editor, Mathematics of Program Construction, MPC’98, Proceedings, volume 1422 of Lecture Notes in Computer Science, pages 52–67. Springer Verlag, 1998.
Richard Bird and Ross Paterson. Generalised folds for nested datatypes. Formal Aspects of Computing, 11(2):200–222, 1999.
Richard S. Bird and Ross Paterson. De Bruijn notation as a nested datatype. Journal of Functional Programming, 9(1):77–91, 1999.
Herman Geuvers. Inductive and coinductive types with iteration and recursion. In Bengt Nordström, Kent Pettersson, and Gordon Plotkin, editors, Proceedings of the 1992 Workshop on Types for Proofs and Programs, Båstad, Sweden, June 1992, pages 193–217, 1992. Only published via ftp://ftp.cs.chalmers.se/pub/cs-reports/baastad.92/proc.dvi.Z.
Jean-Yves Girard. Interprétation fonctionnelle et élimination des coupures dans l’arithmétique d’ordre supérieur. Thèse de Doctorat d’État, Université de Paris VII, 1972.
Tatsuya Hagino. A typed lambda calculus with categorical type constructors. In D. H. Pitt, A. Poigné, and D. E. Rydeheard, editors, Category Theory and Computer Science, volume 283 of Lecture Notes in Computer Science, pages 140–157. Springer Verlag, 1987.
Ralf Hinze. Efficient generalized folds. In Johan Jeuring, editor, Proceedings of the Second Workshop on Generic Programming, WGP 2000, Ponte de Lima, Portugal, July 2000.
Ralf Hinze. Polytypic values possess polykinded types. Science of Computer Programming, MPC Special Issue, 43:129–159, 2002.
W. A. Howard. The formulae-as-types notion of construction. In J. P. Seldin and J. R. Hindley, editors, To H. B. Curry: Essays on Combinatory Logic, Lambda Calculus and Formalism, pages 479–490. Academic Press, 1980.
C. Barry Jay, Gianna Bellè, and Eugenio Moggi. Functorial ML. Journal of Functional Programming, 8(6):573–619, 1998.
Saunders Mac Lane. Categories for the Working Mathematician, volume 5 of Graduate Texts in Mathematics. Springer Verlag, second edition, 1998.
Daniel Leivant. Contracting proofs to programs. In Piergiorgio Odifreddi, editor, Logic and Computer Science, volume 31 of APIC Studies in Data Processing, pages 279–327. Academic Press, 1990.
Ralph Matthes. Extensions of System F by Iteration and Primitive Recursion on Monotone Inductive Types. PhD thesis, Ludwig-Maximilians-University, May 1998.
Ralph Matthes. Monotone inductive and coinductive constructors of rank 2. In Laurent Fribourg, editor, Proceedings of CSL 2001, volume 2142 of Lecture Notes in Computer Science, pages 600–614. Springer Verlag, 2001.
Nax P. Mendler. Recursive types and type constraints in second-order lambda calculus. In Proceedings of the Second Annual IEEE Symposium on Logic in Computer Science, Ithaca, N.Y., pages 30–36. IEEE Computer Society Press, 1987.
Chris Okasaki. From fast exponentiation to square matrices: An adventure in types. In Proceedings of the fourth ACM SIGPLAN International Conference on Functional Programming (ICFP’ 99), Paris, France, September 27–29, 1999, volume 34 of SIGPLAN Notices, pages 28–35. ACM, 1999.
William W. Tait. A realizability interpretation of the theory of species. In R. Parikh, editor, Logic Colloquium Boston 1971/72, volume 453 of Lecture Notes in Mathematics, pages 240–251. Springer Verlag, 1975.
G. C. Wraith. A note on categorical datatypes. In D. H. Pitt, A. Poigné, and D. E. Rydeheard, editors, Category Theory and Computer Science, volume 389 of Lecture Notes in Computer Science, pages 118–127. Springer Verlag, 1989.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2003 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Abel, A., Matthes, R. (2003). (Co-)Iteration for Higher-Order Nested Datatypes. In: Geuvers, H., Wiedijk, F. (eds) Types for Proofs and Programs. TYPES 2002. Lecture Notes in Computer Science, vol 2646. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-39185-1_1
Download citation
DOI: https://doi.org/10.1007/3-540-39185-1_1
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-14031-3
Online ISBN: 978-3-540-39185-2
eBook Packages: Springer Book Archive