Type-indexed rows

Record calculi use labels to distinguish between the elements of products and sums. This paper presents a novel variation, type-indexed rows, in which labels are discarded and elements are indexed by their type alone. The calculus, λTIR, can express tuples, recursive datatypes, monomorphic records, polymorphic extensible records, and closed-world style type-based overloading. Our motivating application of λTIR, however, is to encode the "choice" types of XML, and the "unordered tuple" types of SGML. Indeed, λTIR is the kernel of the language XMλ, a lazy functional language with direct support for XML types ("DTDs") and terms ("documents").The system is built from rows, equality constraints, insertion constraints and constrained, or qualified, parametric polymorphism. The test for constraint satisfaction is complete, and for constraint entailment is only mildly incomplete. We present a type checking algorithm, and show how λTIR may be implemented by a type-directed translation which replaces type-indexing by conventional natural-number indexing. Though not presented in this paper, we have also developed a constraint simplification algorithm and type inference system.

[1]  Gordon D. Plotkin,et al.  An ideal model for recursive polymorphic types , 1984, Inf. Control..

[2]  Mitchell Wand,et al.  Complete Type Inference for Simple Objects , 1987, LICS.

[3]  Philip Wadler,et al.  How to make ad-hoc polymorphism less ad hoc , 1989, POPL '89.

[4]  Luca Cardelli,et al.  Operations on records , 1989, Mathematical Structures in Computer Science.

[5]  Benjamin C. Pierce,et al.  A record calculus based on symmetric concatenation , 1991, POPL '91.

[6]  Mitchell Wand,et al.  Type inference for record concatenation and multiple inheritance , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[7]  Didier Rémy,et al.  Typing record concatenation for free , 1992, POPL '92.

[8]  Alexander Aiken,et al.  Type inclusion constraints and type inference , 1993, FPCA '93.

[9]  Didier Rémy,et al.  Type inference for records in natural extension of ML , 1994 .

[10]  Mark P. Jones Qualified Types: Theory and Practice , 1994 .

[11]  Mariangiola Dezani-Ciancaglini,et al.  Intersection and Union Types: Syntax and Semantics , 1995, Inf. Comput..

[12]  Mark P. Jones Simplifying and improving qualified types , 1995, FPCA '95.

[13]  Atsushi Ohori,et al.  A polymorphic record calculus and its compilation , 1995, TOPL.

[14]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[15]  Benedict R. Gaster,et al.  A Polymorphic Type System for Extensible Records and Variants , 1996 .

[16]  C. M. Sperberg-McQueen,et al.  Extensible markup language , 1997 .

[17]  Benjamin C. Pierce,et al.  Intersection types and bounded polymorphism , 1993, Mathematical Structures in Computer Science.

[18]  John C. Reynolds,et al.  Design of the programming language FORSYTHE , 1997 .

[19]  Simon Peyton Jones,et al.  Lightweight Extensible Records for Haskell , 1999 .

[20]  Alexander Aiken,et al.  Introduction to Set Constraint-Based Program Analysis , 1999, Sci. Comput. Program..

[21]  Martin Odersky,et al.  Type Inference with Constrained Types , 1999, Theory Pract. Object Syst..

[22]  Peter Buneman,et al.  Union Types for Semistructured Data , 1999, DBPL.

[23]  Colin Runciman,et al.  Haskell and XML: generic combinators or type-based translation? , 1999, ICFP '99.

[24]  Benjamin C. Pierce,et al.  Regular expression types for XML , 2000, TOPL.

[25]  John Launchbury,et al.  Implicit parameters: dynamic scoping with static types , 2000, POPL '00.

[26]  Dan Suciu,et al.  Typechecking for XML transformers , 2000, J. Comput. Syst. Sci..

[27]  John Launchbury,et al.  Static types for dynamic documents , 2001 .