Sciweavers

ICFP
2005
ACM

Scrap your boilerplate with class: extensible generic functions

14 years 11 months ago
Scrap your boilerplate with class: extensible generic functions
The `Scrap your boilerplate' approach to generic programming allows the programmer to write generic functions that can traverse arbitrary data structures, and yet have type-specific cases. However, the original approach required all the type-specific cases to be supplied at once, when the recursive knot of generic function definition is tied. Hence, generic functions were closed. In contrast, Haskell's type classes support open, or extensible, functions that can be extended with new type-specific cases as new data types are defined. In this paper, we extend the `Scrap your boilerplate' approach to support this open style. On the way, we demonstrate the lity of abstraction over type classes, and the usefulness of recursive dictionaries.
Ralf Lämmel, Simon L. Peyton Jones
Added 13 Dec 2009
Updated 13 Dec 2009
Type Conference
Year 2005
Where ICFP
Authors Ralf Lämmel, Simon L. Peyton Jones
Comments (0)