|
ABSTRACT
We show that any functional language with record extension possesses record concatenation for free. We exhibit a translation from the latter into the former. We obtain a type system for a language with record concatenation by composing the translation with type-checking in a language with record extension. We apply this method to a version of ML with a record extension and obtain an extension of ML with either asymmetric or symmetric concatenation. The latter extension is simple, flexible and has a very efficient type inference algorithm in practice. Concatenation together with removal of fields needs one more construct than extension of records. It can be added to the version of ML with record extension. However, many typed languages with record cannot type such a construct. The method still applies to them, producing type systems for record concatenation without removal of fields. Object systems also benefit of the encoding which shows that multiple inheritance does not actually require the concatenation of records but only their extension.
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.
| |
Car86
|
|
| |
CH89
|
Guy Cousineau and G~rard Huet. The CAM{, Primer. Institut National de Recherche en Informatique et Automatisme, France, 1989.
|
| |
CM89
|
|
| |
HMT90
|
Robert Harper, Robin Milner, and Mads ToRe. The definition of Standard ML. The MIT Press, 19!)0.
|
| |
HP90a
|
Robert W. Harper and Benjamin C. Pierce. Extensible records without subsumption. Technical Report CMU-CS-90- 102, Carnegie Mellon University, Pittsburg, Pensylvania, February 1990.
|
| |
HP90b
|
Robert W. Harper and Benjamin C. Pierce. A record calculus based on symmetric concatenation. Technical Report CMU-CS-90- 157, Carnegie Mellon University, Pittsburg, Pensylvania, February 1990.
|
 |
JM88
|
|
 |
OB88
|
|
| |
Oho90
|
Atsushi Ohori. Extending ml polymorphism to record structure. Technical report~ University of Glasgow~ 1990.
|
| |
Rém90
|
Didier l~(~my. Alg~bres To uffues. Application au Typage Polymorphe des Objects Enregistrements dan8 les Langages Fonctionnels. Th~se de doctorat, Universit~ de Paris 7, 1990.
|
| |
Rém91a
|
Didier R~my. Syntactic theories and the algebra of record terms. Technical report~ Inria, Rocquencourt, 1991. To appear. Also in {Remg0a}, chapter 2.
|
| |
Rém91b
|
Didier R~my. Type inference for records in a natural extension of ML. Technical Report 1431, Inria, Rocquencourt, May 1991. Also in {Remg0}, chapter 4.
|
| |
Wan87
|
Mitchell Wand. Complete type inference for simple objects. In Second Symposium on Logic In Computer Science~ 1987.
|
| |
Wan88
|
Mitchell Wand. Corrigendum: Complete type inference for simple objects. In Third Symposium on Logic In Computer Science, 1988.
|
| |
Wan89
|
|
| |
Wei89
|
Pierre Weis. The CAML Reference Manual. Institut National de Recherche en Informatique ct Automatisme, France, 1989.
|
|