Using Kinds to Represent Heterogeneous Collections in a Static Type System (Extended Abstract)

We consider the problem of representing heterogeneous collections of objects in a typed polymorphic programming language in such a way that common properties of members of a collection, such as having commonly named field with a common type can be expressed in the type system. The use of such collections is widespread in object-oriented and database programming and has so far been achieved in statically typed systems only through the use of a single dynamic type, which effectively hides all the structure of a value. In this paper we exploit a system of types and kinds (sets of types) to represent dynamic values with some known properties. The type system is shown to be sound and to have a complete type inference algorithm. Comments University of Pennsylvania Department of Computer and Information Science Technical Report No. MSCIS-90-62. This technical report is available at ScholarlyCommons: http://repository.upenn.edu/cis_reports/562 Using Kinds To Represent Heterogeneous Collections In A Static Type System (Extended Abstract) MS-CIS-90-62 LOGIC & COMPUTATION 22 Peter Buneman University of Pennsylvania Atsushi Ohori University of Glasgow Department of Computer and Informat ion Science School of Engineering and Applied Science University of Pennsylvania Philadelphia, PA 19 104

[1]  John C. Mitchell Toward a typed foundation for method specialization and inheritance , 1989, POPL '90.

[2]  Didier Rémy,et al.  Type checking records and variants in a natural extension of ML , 1989, POPL '89.

[3]  William R. Cook,et al.  Inheritance is not subtyping , 1989, POPL '90.

[4]  Luca Cardelli,et al.  A Semantics of Multiple Inheritance , 1984, Information and Computation.

[5]  Luca Cardelli,et al.  On understanding types, data abstraction, and polymorphism , 1985, CSUR.

[6]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[7]  J. Roger Hindley,et al.  Introduction to combinators and λ-calculus , 1986, Acta Applicandae Mathematicae.

[8]  Atsushi Ohori,et al.  Semantics of Types for Database Objects , 1988, Theor. Comput. Sci..

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

[10]  Satish R. Thatte,et al.  Type Inference with Partial Types , 1988, Theor. Comput. Sci..

[11]  John C. Mitchell,et al.  ML with extended pattern matching and subtypes , 1988, LISP and Functional Programming.

[12]  Peter Buneman,et al.  Using Powerdomains to Generalize Relational Databases , 1991, Theor. Comput. Sci..

[13]  Peter Buneman,et al.  Type inference in a database programming language , 1988, LISP and Functional Programming.

[14]  Robin Milner,et al.  A Theory of Type Polymorphism in Programming , 1978, J. Comput. Syst. Sci..

[15]  R. Hindley The Principal Type-Scheme of an Object in Combinatory Logic , 1969 .

[16]  Peter Buneman,et al.  Can Object-Oriented Databases be Statically Typed? , 1989, DBPL.

[17]  Martín Abadi,et al.  Dynamic typing in a statically-typed language , 1989, POPL '89.