A lightweight implementation of generics and dynamics

  • Authors:
  • James Cheney;Ralf Hinze

  • Affiliations:
  • Cornell University, Ithaca, NY;Institut für Informatik III, Universität Bonn Römerstraße 164, 53117 Bonn, Germany

  • Venue:
  • Proceedings of the 2002 ACM SIGPLAN workshop on Haskell
  • Year:
  • 2002

Quantified Score

Hi-index 0.01

Visualization

Abstract

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.