A Lightweight Implementation of Generics and Dynamics

James Cheney, Ralf Hinze

Research output: Chapter in Book/Report/Conference proceedingConference contribution


The recent years have seen a number of proposals for extending statically typed languages by dynamics or generics. Most proposals --- if not all --- require significant extensions to the underlying language. In this paper we show that this need not be the case. We propose a particularly lightweight extension that supports both dynamics and generics. Furthermore, the two features are smoothly integrated: dynamic values, for instance, can be passed to generic functions. Our proposal makes do with a standard Hindley-Milner type system augmented by existential types. Building upon these ideas we have implemented a small library that is readily usable both with Hugs and with the Glasgow Haskell compiler.
Original languageEnglish
Title of host publicationProceedings of the 2002 ACM SIGPLAN Workshop on Haskell
Place of PublicationNew York, NY, USA
Number of pages15
ISBN (Print)1-58113-605-6
Publication statusPublished - 2002

Publication series

NameHaskell '02


  • dynamic typing, generic programming, type representations

Cite this