MLstruct: Principal Type Inference in a Boolean Algebra of Structural Types
Intersection and union types are becoming more popular by the day, entering the mainstream in programming languages like TypeScript and Scala 3. Yet, no language so far has managed to combine these powerful types with principal polymorphic type inference. We present a solution to this problem in MLstruct, a language with subtyped records, equirecursive types, first-class unions and intersections, class-based instance matching, and ML-style principal type inference. While MLstruct is mostly structurally typed, it contains a healthy sprinkle of nominality for classes, which gives it desirable semantics, enabling the expression of a powerful form of extensible variants that does not need row variables. Technically, we define the constructs of our language using conjunction, disjunction, and negation connectives, making sure they form a Boolean algebra, and we show that the addition of a few nonstandard but sound subtyping rules gives us enough structure to derive a sound and complete type inference algorithm. With this work, we hope to foster the development of better type inference for present and future programming languages with expressive subtyping systems.
Slides (oopsla-parreaux-mlstruct.pdf) | 265KiB |
Thu 8 DecDisplayed time zone: Auckland, Wellington change
10:30 - 12:00 | |||
10:30 30mResearch paper | C to checked C by 3c OOPSLA Aravind Machiry Purdue University, John Kastner Amazon, Matt McCutchen , Aaron Eline Amazon, Kyle Headley Amazon, MIchael Hicks Amazon DOI | ||
11:00 30mTalk | Solo: A Lightweight Static Analysis for Differential Privacy OOPSLA DOI | ||
11:30 30mTalk | MLstruct: Principal Type Inference in a Boolean Algebra of Structural Types OOPSLA Lionel Parreaux Hong Kong University of Science and Technology, Chun Yin Chau The Hong Kong University of Science and Technology DOI Pre-print Media Attached File Attached |