|
ABSTRACT
Two different ways of defining ad-hoc polymorphic operations commonly occur in programming languages. With the first form polymorphic operations are defined inductively on the structure of types while with the second form polymorphic operations are defined for specific sets of types.In intensional type analysis operations are defined by induction on the structure of types. Therefore no new cases are necessary for user-defined types, because these types are eQuivalent to their underlying structure. However, intensional type analysis is "closed" to extension, as the behavior of the operations cannot be differentiated for the new types, thus destroying the distinctions that these types are designed to express.Haskell type classes on the other hand define polymorphic operations for sets of types. Operations defined by class instances are considered "open"---the programmer can add instances for new types without modifying existing code. However, the operations must be extended with specialized code for each new type, and it may be tedious or even impossible to add extensions that apply to a large universe of new types.Both approaches have their benefits, so it is important to let programmers decide which is most appropriate for their needs. In this paper, we define a language that supports both forms of ad-hoc polymorphism, using the same basic constructs.
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
|
D. Clarke, R. Hinze, J. Jeuring, A. Löh, and J. de Wit. The Generic Haskell user's guide. Technical Report UU-CS-2001-26, Utrecht University, 2001.
|
| |
3
|
R. Cockett and T. Fukushima. About Charity. Yellow Series Report No. 92/480/18, Department of Computer Science, The University of Calgary, June 1992.
|
 |
4
|
|
| |
5
|
|
 |
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
|
V. Gapeyev and B. Pierce. Regular object types. In Proc. 10th International Workshops on Foundations of Object-Oriented Languages, FOOL '03, New Orleans, LA, USA, Jan. 2003.
|
| |
8
|
J. Garrigue. Programming with polymorphic variants. In ML Workshop, Sept. 1998.
|
| |
9
|
J.-Y. Girard. Interprétation fonctionelle et élimination des coupures de l'arithmétiQue d'ordre supérieur. PhD thesis, Université Paris VII, 1972.
|
 |
10
|
|
 |
11
|
|
 |
12
|
|
 |
13
|
|
| |
14
|
R. Hinze. Polytypic values possess polykinded types. Science of Computer Programming, 43(2--3):129--159, 2002. MPC Special Issue.
|
| |
15
|
R. Hinze and S. Peyton Jones. Derivable type classes. In G. Hutton, editor, Proceedings of the Fourth Haskell Workshop, Montreal, Canada, September 17, 2000, volume 41.1 of Electronic Notes in Theoretical Computer Science. Elsevier Science, Aug. 2000.
|
| |
16
|
|
 |
17
|
|
| |
18
|
C. Jay. Programming in FISh. International Journal on Software Tools for Technology Transfer, 2:307--315, 1999.
|
| |
19
|
|
 |
20
|
|
 |
21
|
James J. Leifer , Gilles Peskine , Peter Sewell , Keith Wansbrough, Global abstraction-safe marshalling with hash types, Proceedings of the eighth ACM SIGPLAN international conference on Functional programming, p.87-98, August 25-29, 2003, Uppsala, Sweden
|
 |
22
|
|
| |
23
|
|
 |
24
|
Greg Morrisett , Matthias Felleisen , Robert Harper, Abstract models of memory management, Proceedings of the seventh international conference on Functional programming languages and computer architecture, p.66-77, June 26-28, 1995, La Jolla, California, United States
[doi> 10.1145/224164.224182]
|
| |
25
|
S. Peyton Jones, editor. Haskell 98 Language and Libraries: The Revised Report. Cambridge University Press, 2003.
|
 |
26
|
|
| |
27
|
|
| |
28
|
J. C. Reynolds. Types, abstraction and parametric polymorphism. In Information Processing '83, pages 513--523. North-Holland, 1983. Proceedings of the IFIP 9th World Computer Congress.
|
 |
29
|
|
 |
30
|
|
 |
31
|
|
 |
32
|
Joseph C. Vanderwaart , Derek Dreyer , Leaf Petersen , Karl Crary , Robert Harper , Perry Cheng, Typed compilation of recursive datatypes, Proceedings of the 2003 ACM SIGPLAN international workshop on Types in languages design and implementation, January 18-18, 2003, New Orleans, Louisiana, USA
|
| |
33
|
D. Vytiniotis, G. Washburn, and S. Weirich. An open and shut typecase. Technical Report MS-CIS-04-26, University of Pennsylvania, 2004. Available from http://www.cis.upenn.edu/~dimitriv/itaname.
|
 |
34
|
|
| |
35
|
|
| |
36
|
|
| |
37
|
M. Zenger and M. Odersky. Independently extensible solutions to the expression problem. Technical Report IC/2004/33, EPFL Lausanne, Switzerland, 2004.
|
CITED BY 4
|
|
|
|
|
|
|
|
John Billings , Peter Sewell , Mark Shinwell , Rok Strniša, Type-safe distributed programming for OCaml, Proceedings of the 2006 workshop on ML, September 16-16, 2006, Portland, Oregon, USA
|
|
|
|
|