Skip to main content

Patterns in Datatype−Generic Programming

Jeremy Gibbons

Abstract

Generic programming consists of increasing the expressiveness of programs by allowing a wider variety of kinds of parameter than is usual. The most popular instance of this scheme is the C++ Standard Template Library. Datatype-generic programming is another instance, in which the parameters take the form of datatypes. We argue that datatype-generic programming is sufficient to express essentially all the genericity found in the Standard Template Library. Moreover, datatype-generic programming is a precisely-defined notion with a rigorous mathematical foundation, in contrast to generic programming in general and the C++ template mechanism in particular, and thereby offers the prospect of better static checking and a greater ability to reason about generic programs. This paper describes work in progress.

Book Title
Multiparadigm Programming
Editor
Jörg Striegnitz and Kei Davis
ISBN
3−00−016005−1
Note
First International Workshop on Declarative Programming in the Context of Object−Oriented Languages (DPCOOL)
Pages
277−289
Publisher
John von Neumann Institute for Computing (NIC)
Volume
27
Year
2003