Practical Type Inference for the GADT Type System

Publication Year:
2010
Usage 186
Downloads 156
Abstract Views 30
Repository URL:
https://pdxscholar.library.pdx.edu/open_access_etds/367
DOI:
10.15760/etd.367
Author(s):
Lin, Chuan-kai
Publisher(s):
Portland State University Library
Tags:
Functional programming languages; Generalized algebraic data types (Computer science); Data structures (Computer science); Algebra -- Data processing
report description
Generalized algebraic data types (GADTs) are a type system extension to algebraic data types that allows the type of an algebraic data value to vary with its shape. The GADT type system allows programmers to express detailed program properties as types (for example, that a function should return a list of the same length as its input), and a general-purpose type checker will automatically check those properties at compile time. Type inference for the GADT type system and the properties of the type system are both currently areas of active research. In this dissertation, I attack both problems simultaneously by exploiting the symbiosis between type system research and type inference research. Deficiencies of GADT type inference algorithms motivate research on specific aspects of the type system, and discoveries about the type system bring in new insights that lead to improved GADT type inference algorithms. The technical contributions of this dissertation are therefore twofold: in addition to new GADT type system properties (such as the prevalence of pointwise type information flow in GADT patterns, a generalized notion of existential types, and the effects of enforcing the GADT branch reachability requirement), I will also present a new GADT type inference algorithm that is significantly more powerful than existing algorithms. These contributions should help programmers use the GADT type system more effectively, and they should also enable language implementers to provide better support for the GADT type system.