ACM Home Page
Please provide us with feedback. Feedback
Generics for the masses
Full text PdfPdf (153 KB)
Source International Conference on Functional Programming archive
Proceedings of the ninth ACM SIGPLAN international conference on Functional programming table of contents
Snow Bird, UT, USA
SESSION: Session VIII table of contents
Pages: 236 - 243  
Year of Publication: 2004
ISBN:1-58113-905-5
Also published in ...
Author
Ralf Hinze  Universität Bonn, Bonn, Germany
Sponsors
ACM: Association for Computing Machinery
SIGPLAN: ACM Special Interest Group on Programming Languages
Publisher
ACM  New York, NY, USA
Bibliometrics
Downloads (6 Weeks): 7,   Downloads (12 Months): 46,   Citation Count: 13
Additional Information:

abstract   references   cited by   index terms   collaborative colleagues  

Tools and Actions: Request Permissions Request Permissions    Review this Article  
DOI Bookmark: Use this link to bookmark this Article: http://doi.acm.org/10.1145/1016850.1016882
What is a DOI?

ABSTRACT

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.


REFERENCES

Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.

 
1
Roland Backhouse, Patrik Jansson, Johan Jeuring, and Lambert Meertens. Generic Programming --- An Introduction ---. In S. Doaitse Swierstra, Pedro R. Henriques, and Jose N. Oliveira, editors, 3rd International Summer School on Advanced Functional Programming, Braga, Portugal, volume 1608 of Lecture Notes in Computer Science, pages 28--115. Springer-Verlag, Berlin, 1999.
2
3
 
4
Ralf Hinze. Polytypic values possess polykinded types. Science of Computer Programming, 43:129--159, 2002.
 
5
Ralf Hinze. Fun with phantom types. In Jeremy Gibbons and Oege de Moor, editors, The Fun of Programming, pages 245--262. Palgrave Macmillan, 2003. ISBN 1-4039-0772-2 hardback, ISBN 0-333-99285-7 paperback.
 
6
Ralf Hinze and Johan Jeuring. Generic Haskell: Applications. In Roland Backhouse and Jeremy Gibbons, editors, Generic Programming: Advanced Lectures, volume 2793 of Lecture Notes in Computer Science. Springer-Verlag, 2003.
 
7
Ralf Hinze and Johan Jeuring. Generic Haskell: Practice and theory. In Roland Backhouse and Jeremy Gibbons, editors, Generic Programming: Advanced Lectures, volume 2793 of Lecture Notes in Computer Science. Springer-Verlag, 2003.
 
8
9
10
 
11
Simon Peyton Jones. Haskell 98 Language and Libraries. Cambridge University Press, 2003.
12
 
13
Philip Wadler. A prettier printer. In Jeremy Gibbons and Oege de Moor, editors, The Fun of Programming, Cornerstones of Computing, pages 223--243. Palgrave Macmillan Publishers Ltd, March 2003.
 
14
Stephanie Weirich. Higher-order intensional type analysis in type-erasure semantics. Available from http://www.cis.upenn.edu/~sweirich/papers/erasure/erasure-paper-july03.pdf, 2003.

CITED BY  13