Early versions of Haskell provied only a positional notation to build and take apart user-de ned datatypes. This positional notation is awkward and error-prone when dealing with datatypes that have more than a couple of components, so later versions of Haskell introduced a mechanism for labeled elds that allows components to be set and extracted by name. While this has been useful in practice, it also has several signi cant problems; for example, no eld name can be used in more than one datatype. In this paper, we present a concrete proposal for replacing the labeledeld mechanisms of Haskell 98 with a more exible system of records that avoids the problems mentioned above. With a theoretical foundation in the earlier work of Gaster and Jones, our system o ers lightweight, extensible records and a complement of polymorphic operations for manipulating them. On a more concrete level, our proposal is a direct descendent of the Trex implementation (\typed records with extensibility") in Hugs, but freed from the constraints of that setting, where compatibility with Haskell 98 was a major concern.
[1]
Mark P. Jonesy.
A Theory of Qualiied Types
,
1992
.
[2]
Mitchell Wand,et al.
Type inference for record concatenation and multiple inheritance
,
1989,
[1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.
[3]
Luca Cardelli,et al.
Operations on records
,
1989,
Mathematical Structures in Computer Science.
[4]
Luca Cardelli,et al.
Extensible records in a pure calculus of subtyping
,
1994
.
[5]
Mark P. Jones,et al.
Using parameterized signatures to express modular structure
,
1996,
POPL '96.
[6]
Peter Buneman,et al.
Theoretical Aspects of Object-Oriented Programming
,
1994
.
[7]
Benedict R. Gaster.
Records, variants and qualified types
,
1998
.
[8]
Didier Rémy,et al.
Typing record concatenation for free
,
1992,
POPL '92.
[9]
Benedict R. Gaster,et al.
A Polymorphic Type System for Extensible Records and Variants
,
1996
.
[10]
Atsushi Ohori,et al.
A polymorphic record calculus and its compilation
,
1995,
TOPL.