首页 | 本学科首页   官方微博 | 高级检索  
     


Dictionary-free overloading by partial evaluation
Authors:Mark P Jones
Affiliation:(1) Department of Computer Science, University of Nottingham, NG7 2RD Nottingham, UK
Abstract:One of the most novel features in the functional programming language Haskell is the system oftype classes used to support a combination of overloading and polymorphism. Current implementations of type class overloading are based on the use ofdictionary 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.This work was carried out while the author was a member of the Department of Computer Science, Yale University, and was supported in part by a grant from ARPA, contract number N00014-91-J-4043.
Keywords:Partial evaluation  type class overloading  Haskell  specialization
本文献已被 SpringerLink 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号