Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/155090.155112acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
Article
Free access

Implementing type classes

Published: 01 June 1993 Publication History
  • Get Citation Alerts
  • Abstract

    We describe the implementation of a type checker for the functional programming language Haskell that supports the use of type classes. This extends the type system of ML to support overloading (ad-hoc polymorphism) and can be used to implement features such as equality types and numeric overloading in a simple and general way.
    The theory of type classes is well understood, but the practical issues involved in the implementation of such systems have not received a great deal of attention. In addition to the basic type checking algorithm, an implmenentation of type classes also requires some form of program transformation. In all current Haskell compilers this takes the form of dictionary conversion, using functions as hidden parameters to overloaded values. We present efficient techniques for type checking and dictionary conversion. A number of optimizations and extensions to the basic type class sytems are also described.

    References

    [1]
    A.W. Appel. A critique of Standard ML. Princeton University CS-TR-364-92, February 1992.
    [2]
    A.W. Appel. Compiling with continuations. Cambridge University Press, 1992.
    [3]
    L. Augustsson. Implementing HaskeH overloading. To appear in Conference on Functional Programming Languages and Computer Architecture, Copenhagen, Denmark, June 1993.
    [4]
    L. Damas and R. Milner. Principal type schemes for functional programs. In 8th Annual A CM Symposium on Principles of Programming languages, 1982.
    [5]
    K. Hammond and S. Blott. Implementing Haskell type classes. Proceedings of the 1989 Glasgow Workshop on Functional Programming, Fraserburgh, Scotland. Workshops in computing series, Springer Verlag.
    [6]
    P. Hudak, S.L. Peyton Jones and P. Wadler (eds.). Report on the programming language Haskell, version 1.2. A CM SIGPLAN notices, 27, 5, May 1992.
    [7]
    M.P. Jones. Computing with lattices: An application of type classes. Journal of Functional Programming, Volume 2, Part 4, October 1992.
    [8]
    M.P. Jones. Qualified types: Theory and Practice. D. Phil. Thesis. Programming Research Group, Oxford University Computing Laboratory. July 1992.
    [9]
    S.L. Peyton Jones and D. Lester. A modular fully-lazy lambda lifter in HaskeU. Software - Practice and Experience, 21(5), May 1991.
    [10]
    S.L. Peyton Jones and P. Wadler. A static semantics for Haskell (draft). Manuscript, Department of Computing Science, University of Glasgow, February 1992.
    [11]
    P. WacUer and S. Blott. How to make ad-hoc polymorphism less ad-hoc. In A CM Principles of Programming Languages, 1989.

    Cited By

    View all

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    PLDI '93: Proceedings of the ACM SIGPLAN 1993 conference on Programming language design and implementation
    August 1993
    313 pages
    ISBN:0897915984
    DOI:10.1145/155090
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 01 June 1993

    Permissions

    Request permissions for this article.

    Check for updates

    Qualifiers

    • Article

    Conference

    PLDI93
    Sponsor:

    Acceptance Rates

    Overall Acceptance Rate 406 of 2,067 submissions, 20%

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)180
    • Downloads (Last 6 weeks)30
    Reflects downloads up to 11 Aug 2024

    Other Metrics

    Citations

    Cited By

    View all
    • (2024)Double-Ended Bit-Stealing for Algebraic Data TypesProceedings of the ACM on Programming Languages10.1145/36746288:ICFP(88-120)Online publication date: 15-Aug-2024
    • (2024)Explicit Effects and Effect Constraints in ReMLProceedings of the ACM on Programming Languages10.1145/36329218:POPL(2370-2394)Online publication date: 5-Jan-2024
    • (2022)Embedded pattern matchingProceedings of the 15th ACM SIGPLAN International Haskell Symposium10.1145/3546189.3549917(123-136)Online publication date: 6-Sep-2022
    • (2019)High-Performance Defunctionalisation in FutharkTrends in Functional Programming10.1007/978-3-030-18506-0_7(136-156)Online publication date: 24-Apr-2019
    • (2018)Finitary polymorphism for optimizing type-directed compilationProceedings of the ACM on Programming Languages10.1145/32367762:ICFP(1-29)Online publication date: 30-Jul-2018
    • (2016)Ghostbuster: a tool for simplifying and converting GADTsACM SIGPLAN Notices10.1145/3022670.295191451:9(338-350)Online publication date: 4-Sep-2016
    • (2016)Ghostbuster: a tool for simplifying and converting GADTsProceedings of the 21st ACM SIGPLAN International Conference on Functional Programming10.1145/2951913.2951914(338-350)Online publication date: 4-Sep-2016
    • (2015)Type-safe runtime code generation: accelerate to LLVMACM SIGPLAN Notices10.1145/2887747.280431350:12(201-212)Online publication date: 30-Aug-2015
    • (2015)Type-safe runtime code generation: accelerate to LLVMProceedings of the 2015 ACM SIGPLAN Symposium on Haskell10.1145/2804302.2804313(201-212)Online publication date: 30-Aug-2015
    • (2015)Type Class Instances for Type-Level Lambdas in HaskellRevised Selected Papers of the 16th International Symposium on Trends in Functional Programming - Volume 954710.1007/978-3-319-39110-6_4(60-84)Online publication date: 3-Jun-2015
    • Show More Cited By

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Get Access

    Login options

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media