Sciweavers

ICFP
2004
ACM

Generics for the masses

15 years 12 days ago
Generics for the masses
A generic function is a function that can be instantiated on many data types to obtain data type specific functionality. Examples of generic functions are the functions that can be derived in Haskell, such as show, read, and ` '. The recent years have seen a number of proposals that support the definition of generic functions. Some of the proposals define new languages, some define extensions to existing languages. As a common characteristic none of the proposals can be made to work within Haskell 98: they all require something extra, either a more sophisticated type system or an additional language construct. The purpose of this pearl is to show that one can, in fact, program generically within Haskell 98 obviating to some extent the need for fancy type systems or separate tools. Haskell's type classes are at the heart of this approach: they ensure that generic functions can be defined succinctly and, in particular, that they can be used painlessly. Categories and Subject D...
Ralf Hinze
Added 13 Dec 2009
Updated 13 Dec 2009
Type Conference
Year 2004
Where ICFP
Authors Ralf Hinze
Comments (0)