Nested datatypes

  • Richard Bird
  • Lambert Meertens
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1422)


A nested datatype, also known as a non-regular datatype, is a parametrised datatype whose declaration involves different instances of the accompanying type parameters. Nested datatypes have been mostly ignored in functional programming until recently, but they are turning out to be both theoretically important and useful in practice. The aim of this paper is to suggest a functorial semantics for such datatypes, with an associated calculational theory that mirrors and extends the standard theory for regular datatypes. Though elegant and generic, the proposed approach appears more limited than one would like, and some of the limitations are discussed.


Functional Programming Standard Semantic Type Constructor Type Nest Functorial Semantic 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    R. Bird and O. de Moor. Algebra of Programming. International Series in Computing Science. Prentice Hall, 1996.Google Scholar
  2. 2.
    R. S. Bird, P. F. Hoogendijk, and O. De Moor. Generic programming with relations and functors. Journal of Functional Programming, 6(1):1–28, 1996.MathSciNetCrossRefzbMATHGoogle Scholar
  3. 3.
    R.H. Connelly and F. Lockwood Morris. A generalisation of the trie data structure. Mathematical Structures in Computer Science, 5(3):381–418, 1995.MathSciNetzbMATHCrossRefGoogle Scholar
  4. 4.
    Oege de Moor and Paul Hoogendijk. What is a datatype? Technical Report 96/16, Department of Maths and Computing Science, Eindhoven University of Technology, 1996.Google Scholar
  5. 5.
    Paul Hoogendijk. A Generic theory of Data Types. Ph.D Thesis, Eindhoven University of Technology, 1997.Google Scholar
  6. 6.
    L. Fegaras and T. Sheard. Revisiting catamorphisms over datatypes with embedded functions. In 23rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. Association for Computing Machinery, 1996.Google Scholar
  7. 7.
    Peter Freyd. Algebraically complete categories. Springer-Verlag Lecture Notes in Mathematics, vol 1488, 95–104, 1990.MathSciNetGoogle Scholar
  8. 8.
    T. Hagino. Category theoretic approach to data types. PhD thesis, Laboratory for Foundations of Computer Science, University of Edinburgh, UK, 1987. Technical Report ECS-LFCS-87-38.Google Scholar
  9. 9.
    J. Jeuring. Polytypic pattern matching. In S. Peyton Jones, editor, Functional Programming and Computer Architecture, pages 238–248. Association for Computing Machinery, 1995.Google Scholar
  10. 10.
    J. Lambek. A fixpoint theorem for complete categories. Mathematische Zeitschrift, 103:151–161, 1968.zbMATHMathSciNetCrossRefGoogle Scholar
  11. 11.
    Saunders Mac Lane. Categories for the Working Mathematician. Graduate Texts in Mathematics. Springer-Verlag, 1971.Google Scholar
  12. 12.
    G. Malcolm. Data structures and program transformation. Science of Computer Programming, 14(2–3):255–279, 1990.zbMATHMathSciNetCrossRefGoogle Scholar
  13. 13.
    G. Malcolm. Algebraic Data Types and Program Transformation. Ph.D thesis, University of Groningen, The Netherlands, 1990.Google Scholar
  14. 14.
    E.G. Manes and M.A. Arbib. Algebraic Approaches to Program Semantics. Texts and Monographs in Computing Science. Springer-Verlag, 1986.Google Scholar
  15. 15.
    Lambert Meertens. Calculate polytypically! In Herbert Kuchen and S. Doaitse Swierstra, editors, Programming Languages: Implementations Logics, and Programs Proceedings Eighth International Symposium PLILP '96, volume 1140 of LNCS, pages 1–16. Springer-Verlag, 1996.Google Scholar
  16. 16.
    E. Meijer and G. Hutton. Bananas in space: extending fold and unfold to exponential types. In S. Peyton Jones, editor, Functional Progamming Languages and Computer Architecture, pages 324–333. Association for Computing Machinery, 1995.Google Scholar
  17. 17.
    A. Mycroft. Polymorphic type schemes and recursive definitions. In International Symposium on Programming, volume LNCS 167, pages 217–228. Springer-Verlag, 1984.Google Scholar
  18. 18.
    C. Okasaki. Purely Functional Data Structures. Ph.D thesis, School of Computer Science, Carnegie Mellon University, 1996.Google Scholar
  19. 19.
    C. Okasaki. Catenable double-ended queues. In Proceedings of the 1997 ACM SIGPLAN International Conference on Functional Programming (ICFP '97), pages 66–74. ACM, 1997.Google Scholar
  20. 20.
    S. Peyton Jones and J. Launchbury. Explicit quantification in Haskell. See: Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1998

Authors and Affiliations

  • Richard Bird
    • 1
  • Lambert Meertens
    • 2
  1. 1.Programming Research GroupOxford UniversityOxfordUK
  2. 2.CWI and Department of Computer ScienceUtrecht UniversityGB AmsterdamThe Netherlands

Personalised recommendations