article · KiltHub Repository · 2007
Modular Type Classes
Dryer, Derek, Harper, Robert, Chakravarty, Manuel M.T., Keller, Gabriele
Cited by 0Open access
Abstract
ML modules and Haskell type classes have proven to be highly effective tools for program structuring. Modules emphasize explicit configuration of program components and the use of data abstraction. Type classes emphasize implicit program construction and ad hoc polymorphism. In this paper, we show how the implicitly-typed style of type class programming may be supported within the framework of an explicitly-typed module language by viewing type classes as a particular mode of use of modules. This view offers a harmonious integration of modules and type classes, where type class features, such as class hierarchies and associated types, arise naturally as uses of existing module-language constructs, such as module hierarchies and type components. In addition, programmers have explicit control over which type class instances are available for use by type inference in a given scope. We formalize our approach as a Harper-Stone-style elaboration relation, and provide a sound type inference algorithm as a guide to implementation.
Cite this paper
Dryer, D., Harper, R., Chakravarty, M. M., & Keller, G. (2007). Modular Type Classes. KiltHub Repository. https://doi.org/10.1184/r1/6607478
Dryer, Derek, et al. “Modular Type Classes.” KiltHub Repository, 2007, https://doi.org/10.1184/r1/6607478.
Dryer, Derek, Robert Harper, Manuel M.T. Chakravarty, and Gabriele Keller. 2007. “Modular Type Classes.” KiltHub Repository. https://doi.org/10.1184/r1/6607478.
Dryer, D. et al. (2007) ‘Modular Type Classes’, KiltHub Repository. Available at: https://doi.org/10.1184/r1/6607478.
@article{dryer2007modular,
title = {{Modular Type Classes}},
author = {Dryer, Derek and Harper, Robert and Chakravarty, Manuel M.T. and Keller, Gabriele},
journal = {KiltHub Repository},
year = {2007},
doi = {10.1184/r1/6607478}
}Made from the index record. Check names, capitalisation and page numbers against the paper. Need another style? AI for Research has over 10,000.