Sciweavers

IFL
2001
Springer

A Generic Programming Extension for Clean

13 years 9 months ago
A Generic Programming Extension for Clean
Abstract. Generic programming enables the programmer to define functions by induction on the structure of types. Defined once, such a generic function can be used to generate a specialized function for any user defined data type. Several ways to support generic programming in functional languages have been proposed. The approach with kind-indexed types makes it possible to define generic functions indexed by types of different kinds. Another approach allows to define default implementation for instances of type classes in a generic way. In this paper we describe a combination of these two approaches, which has advantages of both of them. The key idea of our approach is that a generic function generates a kind-indexed system of type classes, one class per kind. The class variable of such a class ranges over types of the corresponding kind. For instance, an overloaded equality operator can be defined as a specific case of a generic equality function for kind . Additionally, we pr...
Artem Alimarine, Marinus J. Plasmeijer
Added 30 Jul 2010
Updated 30 Jul 2010
Type Conference
Year 2001
Where IFL
Authors Artem Alimarine, Marinus J. Plasmeijer
Comments (0)