LISP and Symbolic Computation, 8(3)229-248
Dictionary-Free Overloading by Partial Evaluation
Mark P. Jones, Department of Computer Science, University of Nottingham, Nottingham NG7 2RD, UK
Abstract: One of the most novel features in the functional
programming language Haskell is the system of type classes used to
support a combination of overloading and polymorphism. Current
implementations of type class overloading are based on the use of
dictionary values, passed as extra parameters to overloaded
functions. Unfortunately, this can have a significant effect on
run-time performance, for example, by reducing the effectiveness of
important program analyses and optimizations.
This paper describes how a simple partial evaluator can be used to
avoid the need for dictionary values at run-time by generating
specialized versions of overloaded functions. This eliminates the
run-time costs of overloading. Furthermore, and somewhat surprisingly
given the presence of multiple versions of some functions, for all of
the examples that we have tried so far, specialization actually leads
to a reduction in the size of compiled programs.
Keywords: partial evaluation, type class overloading, Haskell, specialization
|
This article is not available online.
|
|