## Manufacturing Datatypes (1999)

### Cached

### Download Links

- [www.informatik.uni-bonn.de]
- [www.informatik.uni-bonn.de]
- [www.informatik.uni-bonn.de]
- [www.cs.bonn.edu]
- DBLP

### Other Repositories/Bibliography

Citations: | 24 - 3 self |

### BibTeX

@MISC{Hinze99manufacturingdatatypes,

author = {Ralf Hinze},

title = {Manufacturing Datatypes},

year = {1999}

}

### Years of Citing Articles

### OpenURL

### Abstract

This paper describes a general framework for designing purely functional datatypes that automatically satisfy given size or structural constraints. Using the framework we develop implementations of different matrix types (eg square matrices) and implementations of several tree types (eg Braun trees, 2-3 trees). Consider, for instance, representing square n \Theta n matrices. The usual representation using lists of lists fails to meet the structural constraints: there is no way to ensure that the outer list and the inner lists have the same length. The main idea of our approach is to solve in a first step a related, but simpler problem, namely to generate the multiset of all square numbers. In order to describe this multiset we employ recursion equations involving finite multisets, multiset union, addition and multiplication lifted to multisets. In a second step we mechanically derive datatype definitions from these recursion equations which enforce the `squareness' constraint. The tra...

### Citations

8523 |
Introduction to Algorithms
- Cormen, Leiserson, et al.
- 2001
(Show Context)
Citation Context ...res that automatically satisfy the given size or structural constraints. Let us illustrate the main ideas by means of example. As a first example, we will devise a representation of Toeplitz matrices =-=[6]-=- where a Toeplitz matrix is an n \Theta n matrix (a ij ) such that a ij = a i\Gamma1;j \Gamma1 for 1 ! i; j 6 n. Clearly, to represent a Toeplitz matrix of size n + 1 it suffices to store 2sn + 1 elem... |

705 |
Data Structures and Algorithms
- Aho, Hopcroft, et al.
- 1987
(Show Context)
Citation Context ...well-suited for implementing search trees: one can prove a lower bound of\Omega\Gamma p n) for insertion and deletion in this case [16]. For that reason, popular search tree schemes such as 2-3 trees =-=[2]-=-, red-black trees [8], or AVL-trees [1] are always based on non-unique representations. Let us consider how to implement, say, 2-3 trees. The other search tree schemes can be handled in an analogous f... |

298 | Functional programming with bananas, lenses, envelopes and barbed wire - Meijer, Fokkinga, et al. - 1991 |

231 |
A dichromatic framework for balanced trees
- Guibas, Sedgewick
- 1978
(Show Context)
Citation Context ...menting search trees: one can prove a lower bound of\Omega\Gamma p n) for insertion and deletion in this case [16]. For that reason, popular search tree schemes such as 2-3 trees [2], red-black trees =-=[8]-=-, or AVL-trees [1] are always based on non-unique representations. Let us consider how to implement, say, 2-3 trees. The other search tree schemes can be handled in an analogous fashion. The definitio... |

227 | Purely Functional Data Structures - Okasaki - 1998 |

178 |
An Algorithm for the Organization of Information
- Adelson-Velskii, Landis
- 1962
(Show Context)
Citation Context ...es: one can prove a lower bound of\Omega\Gamma p n) for insertion and deletion in this case [16]. For that reason, popular search tree schemes such as 2-3 trees [2], red-black trees [8], or AVL-trees =-=[1]-=- are always based on non-unique representations. Let us consider how to implement, say, 2-3 trees. The other search tree schemes can be handled in an analogous fashion. The definition of 2-3 trees is ... |

148 | Algorithm 232: Heapsort - Williams - 1964 |

102 | 98: A non-strict, purely functional language. http://www.haskell.org - Jones, Hughes - 1999 |

96 |
and Oege de Moor. Algebra of Programming
- Bird
- 1997
(Show Context)
Citation Context ...al numbers using the fact that each odd number is of the form 1 + ns2 for some n. odd = H1I + natsH2I nat = H0I ] H1I + nat 1 Categorically speaking, a functor must satisfy additional conditions, see =-=[3]-=-. All the type constructors listed in this paper are functors in the category-theoretical sense. 2 Examples are given in the functional language Haskell 98 [15]. The first equation makes use of the mu... |

94 | A new approach to generic functional programming - Hinze - 2000 |

87 | Algebra of Programming - Bird, Moor - 1997 |

85 | Polymorphic Type Inference - Leivant - 1983 |

79 | Nested datatypes
- BIRD, MEERTENS
- 1998
(Show Context)
Citation Context ...contain pairs of elements. Note that this definition proceeds bottom-up whereas the definition given in the beginning proceeds top-down. The type Perfect is an example for a so-called nested datatype =-=[4]-=-: the recursive call of Perfect on the right-hand side is not a copy of the declared type on the left-hand side, ie the type recursion is nested. As the final example, let us tackle the problem of rep... |

69 | Functional Programming with Overloading and Higher-Order Polymorphism
- Jones
- 1995
(Show Context)
Citation Context ...er-order functor as it takes functors to functors. Accordingly, Matrix 0 is a type constructor of kind ( ! ) ! ( ! ). Recall that the kind system of Haskell specifies the `type' of a type constructor =-=[12]-=-. The `' kind represents nullary constructors like Bool or Int. The kinds1 !s2 represents type constructors that map type constructors of kinds1 to those of kinds2 . Though the type of square matrices... |

29 | An algorithm for the organization of information. Doklady Akademii Nauk SSSR, 146:263–266, (Russian). English translation by Myron - Adelson-Velskii, Landis - 1962 |

29 | From fast exponentiation to square matrices: an adventure in types - Okasaki - 1999 |

13 | Polytypic functions over nested datatypes
- Hinze
- 1999
(Show Context)
Citation Context ...lation. Informally, the functor corresponding to a multiset M contains, for each member of M, a container of that size. This statement can be made precise using the framework of polytypic programming =-=[11]-=-. Briefly, a polytypic function is one that is defined by induction on the structure of functor expressions. A simple example for a polytypic function is sumhf i :: f N ! N, which sums a structure of ... |

13 | Polytypic programming with ease - HINZE - 1999 |

12 | Container types categorically - Hoogendijk, Moor |

11 |
A logarithmic implementation of flexible arrays. Memorandum MR83/4
- Braun, Rem
- 1983
(Show Context)
Citation Context ... vector of size 11 is shown in Figure 2(c). The `firstification' of Vector 0 is left as an exercise to the reader. 4.5 Braun trees Let us apply the framework to design a representation of Braun trees =-=[5]-=-. Braun trees are node-oriented trees, which are characterized by the following balance condition: for all subtrees, the size of the left subtree is either exactly the size of the right subtree, or on... |

10 |
Functional Pearl: Perfect trees and bit-reversal permutations
- Hinze
(Show Context)
Citation Context ...tial use of polymorphic types. 1 Introduction Many information structures are defined by certain size or structural constraints. Take, for instance, the class of perfectly balanced, binary leaf trees =-=[10]-=- (perfect leaf trees for short): a perfect leaf tree of height 0 is a leaf and a perfect leaf tree of height h + 1 is a node with two children, each of which is a perfect leaf tree of height h. How ca... |

9 | Nested datatypes. Pages 52–67 of - Bird, Meertens - 1998 |

7 | international conference on mathematics of program construction - Fourth |

6 |
A simple, efficient, and flexible implementation of flexible arrays
- Dielissen, Kaldewaij
(Show Context)
Citation Context ...tor = Vector 0 (K Unit) Id data Vector 0 t p a = Base (t a) j Even (Vector 0 t (Prod p p) a) j Odd (Vector 0 (Prod t p) (Prod p p) a) This datatype implements rightist right-perfect trees or RR-trees =-=[7]-=- where the offsprings of the nodes on the left spine form a sequence of perfect leaf trees of decreasing height. Note that if we change Prod t p to Prod p t in the last line, we obtain leftist left-pe... |

6 | Polymorphic type schemes and recursive - Mycroft - 1984 |

5 | Numerical Representations as Higher-Order Nested Datatypes
- Hinze
- 1998
(Show Context)
Citation Context ... Haskell datatypes yields type Vector = Vector 0 Id data Vector 0 t a = Null j Zero (Vector 0 (Fork t) a) j One (t a) (Vector 0 (Fork t) a) : This datatype implements higher-order random-access lists =-=[9]-=-. If we `firstify' the type constructor Vector 0 , we obtain the first-order variant as defined in Section 4.2. For a discussion of the tradeoffs we refer the interested reader to [9]. The vector (0; ... |

5 | Indexed types. Theoretical Computer Science, 187:147–165 - Zenger - 1997 |

4 | Perfect trees and bit-reversal permutations - Hinze - 2000 |

2 | A diochromatic framework for balanced trees. Pages 8--21 of - Guibas - 1978 |

2 | Constructing red-black trees. Okasaki, C. (ed - Hinze - 1999 |

2 | Functional Pearl: Three algorithms on Braun trees - Okasaki - 1997 |

2 | On uniquely represented data structures (extended abstract - Snyder - 1977 |

1 | Dependently typed data structures. Okasaki, C. (ed - Xi - 1999 |