## Nested datatypes (1998)

Venue: | In MPC’98, volume 1422 of LNCS |

Citations: | 79 - 5 self |

### BibTeX

@INPROCEEDINGS{Bird98nesteddatatypes,

author = {Richard Bird and Lambert Meertens},

title = {Nested datatypes},

booktitle = {In MPC’98, volume 1422 of LNCS},

year = {1998},

pages = {52--67},

publisher = {Springer-Verlag}

}

### Years of Citing Articles

### OpenURL

### Abstract

Abstract. 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. 1

### Citations

236 |
Categories for the working mathematician. Graduate Texts
- Lane
- 1998
(Show Context)
Citation Context ...nuous. The proof for polynomial functors can be found in [14], and the extension to type functors is in [13]. Moreover, the category Nat (Fun) inherits co-completeness from the base category Fun (see =-=[11,7]-=-). We believe that all regular higher-order functors are co-continuous, though we have not yet found a proof of this in the literature, so the existence of datatypes like Nest and Bush is not likely t... |

227 | Purely Functional Data Structures
- Okasaki
- 1998
(Show Context)
Citation Context ...ard Haskell. The upshot of the current situation is that nested datatypes have been rather neglected in functional programming. However, they are conceptually important and evidence is emerging (e.g. =-=[3,18,19]-=-) of their usefulness in functional data structure design. A brief illustration of what they can offer is given in Section 2. Regular datatypes, on the other hand, are the bread and butter of function... |

105 |
Data structures and program transformation
- Malcolm
- 1990
(Show Context)
Citation Context ...List), the identity and projection functors, using coproduct, product, and composition operations,Nested Datatypes 57 are called regular functors. For further details of the approach, consult, e.g., =-=[12]-=- or [1]. For Nest and Bush the theory above breaks down. For example, introducing Qa =a×a for the squaring functor, the corresponding functorial declaration for Nest would be data Nest a αa ←− F (a , ... |

95 | Bananas in Space: Extending Fold and Unfold to Exponential Types
- Meijer, Hutton
- 1995
(Show Context)
Citation Context ...ard functorial semantics of regular datatypes may be recovered as a special case. It is important to note that we will not consider datatype declarations containing function spaces in this paper; see =-=[6,16]-=- for ways of dealing with function spaces in datatype declarations. 2 An example Let us begin with a small example to show the potential of nested datatypes. The example was suggested to us by Oege de... |

93 |
Polymorphic type schemes and recursive definitions
- Mycroft
- 1984
(Show Context)
Citation Context ...(counting from 0) of a list of type Bush a has type Bush n a. The datatype List a is an example of a so-called regular datatype, while Nest a and Bush a are examples of non-regular datatypes. Mycroft =-=[17]-=- calls such schemes polymorphic recursions. We prefer the term nested datatypes. In a regular datatype declaration, occurrences of the declared type on the right-hand side of the defining equation are... |

92 |
Algebraically complete categories
- Freyd
- 1990
(Show Context)
Citation Context ...ies are “bushed”. For example, one value of type Bush Int is Johan Jeuring (Ed.): MPC’98, LNCS 1422, pp. 52–67, 1998. c○ Springer-Verlag Berlin Heidelberg 1998Nested Datatypes 53 [4, [8,[5],[[3]]], [=-=[7]-=-,[],[[[7]]]], [[[],[[0]]]] ] This bush contains four entries, the first of which is an element of Int, the second an element of Bush Int, the third an element of Bush (Bush Int), and so on. In general... |

86 |
Algebraic Approaches to Program Semantics
- Manes, Arbib
- 1986
(Show Context)
Citation Context ...un has everything needed to make this incantation work: Fun is co-complete (in fact, bi-complete) and all regular functors F on Fun are cocontinuous. The proof for polynomial functors can be found in =-=[14]-=-, and the extension to type functors is in [13]. Moreover, the category Nat (Fun) inherits co-completeness from the base category Fun (see [11,7]). We believe that all regular higher-order functors ar... |

84 |
Algebraic Data Types and Program Transformation
- Malcolm
- 1990
(Show Context)
Citation Context ...on work: Fun is co-complete (in fact, bi-complete) and all regular functors F on Fun are cocontinuous. The proof for polynomial functors can be found in [14], and the extension to type functors is in =-=[13]-=-. Moreover, the category Nat (Fun) inherits co-completeness from the base category Fun (see [11,7]). We believe that all regular higher-order functors are co-continuous, though we have not yet found a... |

54 | Revisiting catamorphism over datatypes with embedded functions
- Fegaras, Sheard
- 1996
(Show Context)
Citation Context ...ard functorial semantics of regular datatypes may be recovered as a special case. It is important to note that we will not consider datatype declarations containing function spaces in this paper; see =-=[6,16]-=- for ways of dealing with function spaces in datatype declarations. 2 An example Let us begin with a small example to show the potential of nested datatypes. The example was suggested to us by Oege de... |

52 |
A fixpoint theorem for complete categories
- Lambek
- 1968
(Show Context)
Citation Context ...is to define a regular datatype as an initial object in a category of F -algebras for an appropriate functor F . Indeed, this idea appeared much earlier in the categorical literature, for instance in =-=[10]-=-. As a consequence, polytypic programs are parametrised by one or more regular functors. Different instances of these functors yield the concrete programs we know and love.54 Richard Bird and Lambert... |

41 | Calculate polytypically
- Meertens
- 1996
(Show Context)
Citation Context ...A brief illustration of what they can offer is given in Section 2. Regular datatypes, on the other hand, are the bread and butter of functional programming. Recent work on polytypic programming (e.g. =-=[2,9,15]-=-) has systematised the mathematics of program construction with regular datatypes by focusing on a small number of generic operators, such as fold, thatcanbe defined for all such types. The basic idea... |

31 |
Category Theoretic Approach to Data Types
- Hagino
- 1987
(Show Context)
Citation Context ...ition of lift) the programs above are acceptable to Haskell 1.4, provided the type signatures are included as part of the definitions. 3 Datatypes as initial algebras The standard semantics (see e.g. =-=[8,10]-=-) of inductive datatypes parametrised by n type parameters employs functors of type C×···×C→C, where the product has n + 1 occurrences of C. For simplicity, we will consider only the case n =1. The ca... |

28 | Polytypic pattern matching
- Jeuring
- 1995
(Show Context)
Citation Context ...A brief illustration of what they can offer is given in Section 2. Regular datatypes, on the other hand, are the bread and butter of functional programming. Recent work on polytypic programming (e.g. =-=[2,9,15]-=-) has systematised the mathematics of program construction with regular datatypes by focusing on a small number of generic operators, such as fold, thatcanbe defined for all such types. The basic idea... |

17 |
A Generic Theory of Data Types
- Hoogendijk
- 1997
(Show Context)
Citation Context ...he list, entries are “bushed”. For example, one value of type Bush Int is Johan Jeuring (Ed.): MPC’98, LNCS 1422, pp. 52–67, 1998. c○ Springer-Verlag Berlin Heidelberg 1998Nested Datatypes 53 [4, [8,=-=[5]-=-,[[3]]], [[7],[],[[[7]]]], [[[],[[0]]]] ] This bush contains four entries, the first of which is an element of Int, the second an element of Bush Int, the third an element of Bush (Bush Int), and so o... |

11 |
A generalization of the trie data structure
- Connelly, Morris
- 1995
(Show Context)
Citation Context ...st, entries are “bushed”. For example, one value of type Bush Int is Johan Jeuring (Ed.): MPC’98, LNCS 1422, pp. 52–67, 1998. c○ Springer-Verlag Berlin Heidelberg 1998Nested Datatypes 53 [4, [8,[5],[=-=[3]-=-]], [[7],[],[[[7]]]], [[[],[[0]]]] ] This bush contains four entries, the first of which is an element of Int, the second an element of Bush Int, the third an element of Bush (Bush Int), and so on. In... |

10 | Catenable double-ended queues
- Okasaki
- 1997
(Show Context)
Citation Context ...ard Haskell. The upshot of the current situation is that nested datatypes have been rather neglected in functional programming. However, they are conceptually important and evidence is emerging (e.g. =-=[3,18,19]-=-) of their usefulness in functional data structure design. A brief illustration of what they can offer is given in Section 2. Regular datatypes, on the other hand, are the bread and butter of function... |

9 | Generic programming with relations and functors
- Bird, Hoogendijk, et al.
- 1993
(Show Context)
Citation Context ...A brief illustration of what they can offer is given in Section 2. Regular datatypes, on the other hand, are the bread and butter of functional programming. Recent work on polytypic programming (e.g. =-=[2,9,15]-=-) has systematised the mathematics of program construction with regular datatypes by focusing on a small number of generic operators, such as fold, thatcanbe defined for all such types. The basic idea... |

2 |
Explicit quantification
- Jones
(Show Context)
Citation Context ...e most recent versions of Hugs and GHC (the Glasgow Haskell Compiler) both support so-called rank-2 type signatures, in which one can universally quantify over type constructors as well as types (see =-=[20]-=-). By using such signatures one can construct most of the functions over nested datatypes that one wants. We will return to this point below. However, rank-2 type signatures are not yet part of standa... |

1 |
What is a datatype
- Moor, Hoogendijk
- 1996
(Show Context)
Citation Context ...ection proves more useful, then there is a need to give a systematic account of the method, not only for an arbitrary inductive nested datatype, but also for coinductive nested datatypes. Finally, in =-=[4]-=- (see also [5]) the idea was proposed that a datatype was a certain kind of functor called a relator, together with a membership relation. It needs to be seen how the notion of membership can be exten... |