A lightweight implementation of generics and dynamics
- 3 October 2002
- proceedings article
- Published by Association for Computing Machinery (ACM)
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.Keywords
This publication has 24 references indexed in Scilit:
- Polytypic values possess polykinded typesScience of Computer Programming, 2002
- The Girard-Reynolds IsomorphismPublished by Springer Nature ,2001
- A modal analysis of staged computationJournal of the ACM, 2001
- Generic ProgrammingPublished by Springer Nature ,1999
- Nested datatypesPublished by Springer Nature ,1998
- Type classes in HaskellACM Transactions on Programming Languages and Systems, 1996
- Dynamic typing in polymorphic languagesJournal of Functional Programming, 1995
- Dynamics in MLJournal of Functional Programming, 1993
- Horn clause programs with polymorphic types: semantics and resolutionTheoretical Computer Science, 1991
- Dynamic typing in a statically typed languageACM Transactions on Programming Languages and Systems, 1991