|
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.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
 |
1
|
|
 |
2
|
Manuel M. T. Chakravarty , Gabriele Keller , Simon Peyton Jones , Simon Marlow, Associated types with class, Proceedings of the 32nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.1-13, January 12-14, 2005, Long Beach, California, USA
|
 |
3
|
|
| |
4
|
|
| |
5
|
Derek Dreyer and Matthias Blume. Principal type schemes for modular programs. Technical Report TR-2006-08, University of Chicago Comp. Sci. Dept., October 2006.
|
 |
6
|
Derek Dreyer , Karl Crary , Robert Harper, A type system for higher-order modules, Proceedings of the 30th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.236-249, January 15-17, 2003, New Orleans, Louisiana, USA
|
| |
7
|
Derek Dreyer, Robert Harper, Manuel M.T. Chakravarty, and Gabriele Keller. Modular type classes. Technical Report TR-2006-09, University of Chicago Comp. Sci. Dept., October 2006.
|
 |
8
|
|
| |
9
|
|
 |
10
|
|
| |
11
|
|
| |
12
|
|
 |
13
|
|
| |
14
|
|
| |
15
|
Mark P. Jones. A system of constructor classes: Overloading and implicit higher-order polymorphism. Journal of Functional Programming, 5(1), 1995.
|
| |
16
|
Wolfram Kahl and Jan Scheffczyk. Named instances for Haskell type classes. In Haskell Workshop, 2001.
|
 |
17
|
|
| |
18
|
|
| |
19
|
Simon Peyton Jones et al. Haskell 98 language and libraries: the revised report. Journal of Functional Programming, 13(1), 2003.
|
| |
20
|
Gerhard Schneider. ML mit Typklassen. Master's thesis, June 2000.
|
| |
21
|
|
 |
22
|
|
 |
23
|
|
| |
24
|
Stefan Wehr. ML modules and Haskell type classes: A constructive comparison. Master's thesis, Albert-Ludwigs-Universität Freiburg, Institut für Informatik, 2005.
|
CITED BY 3
|
|
|
|
|
Martin Sulzmann , Manuel M. T. Chakravarty , Simon Peyton Jones , Kevin Donnelly, System F with type equality coercions, Proceedings of the 2007 ACM SIGPLAN international workshop on Types in languages design and implementation, January 16-16, 2007, Nice, Nice, France
|
|