Skip to main content

A Generic Programming Extension for Clean

  • Conference paper
  • First Online:
Implementation of Functional Languages (IFL 2001)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2312))

Included in the following conference series:

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, each with its own pros and cons. In this paper we describe a combination of two existing approaches, which has the advantages of both of them. In our approach overloaded functions with class variables of an arbitrary kind can be defined generically. A single generic definition defines a kind-indexed family of overloaded functions, one for each kind. For instance, the generic mapping function generates an overloaded mapping function for each kind.

Additionally, we propose a separate extension that allows to specify a customized instance of a generic function for a type in terms of the generated instance for that type.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Ralf Hinze and Simon Peyton Jones. Derivable Type Classes. In Graham Hutton, editor, Proceedings of the Fourth HaskellWorkshop, Montreal, Canada, September 17, 2000

    Google Scholar 

  2. Ralf Hinze. Polytypic values possess polykinded types. In Roland Backhouse, J.N. Oliveira, editors, Proceedings of the Fifth International Conference on Mathematics of Program Construction (MPC 2000), Ponte de Lima, Portugal, July 3–5, 2000.

    Google Scholar 

  3. Ralf Hinze. A New Approach to Generic Functional Programming. In Proceedings of the 27th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, Boston, Massachusetts, January 19–21, 2000.

    Google Scholar 

  4. Ralf Hinze. A Generic Programming Extension for Haskell In Erik Meijer, editor, Proceedings of the Third Haskell Workshop, Paris, France, September 1999. The proceedings appear as a technical report of Universiteit Utrecht, UU-CS-1999-28.

    Google Scholar 

  5. Juan Chen and Andrew W. Appel. Dictionary Passing for Polytypic Polymorphism Princeton University Computer Science TR-635-01, March 2001.

    Google Scholar 

  6. P. Jansson and J. Jeuring, PolyP-a polytypic programming language extension, POPL’ 97: The 24th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, ACM Press 470–482, 1997.

    Google Scholar 

  7. M. J. Plasmeijer, M.C.J.D. van Eekelen Language Report Concurrent Clean. Version 1.3. Technical Report CSI R9816, Faculty of mathematics and Informatics, Catholic University of Nijmegen, June 1998. Also available at http://www.cs.kun.nl/~clean/Manuals/manuals.html

  8. Ralf Lämmel, Joost Visser, and Jan Kort. Dealing with large bananas. In Johan Jeuring, editor, Workshop on Generic Programming, Ponte de Lima, July 2000. Technical Report UU-CS-2000-19, Universiteit Utrecht.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2002 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Alimarine, A., Plasmeijer, R. (2002). A Generic Programming Extension for Clean. In: Arts, T., Mohnen, M. (eds) Implementation of Functional Languages. IFL 2001. Lecture Notes in Computer Science, vol 2312. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-46028-4_11

Download citation

  • DOI: https://doi.org/10.1007/3-540-46028-4_11

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-43537-2

  • Online ISBN: 978-3-540-46028-2

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics