Ambivalent Types for Principal Type Inference with GADTs (extended version)

GADTs, short for Generalized Algebraic DataTypes, which allow constructors of algebraic datatypes to be non-surjective, have many useful applications. However, pattern matching on GADTsintroduces local type equality assumptions, which are a source of ambiguities that may destroy principal types---and must be resolved by type annotations. We introduce ambivalent types to tighten the definition of ambiguities and better confine them, so that type inference has principal types, remains monotonic, and requires fewer type annotations.

Data and Resources

Additional Info

Field Value
Source https://inria.hal.science/hal-00914493
Author Garrigue, Jacques, Rémy, Didier
Maintainer CCSD
Last Updated May 7, 2026, 20:53 (UTC)
Created May 7, 2026, 20:53 (UTC)
Identifier hal-00914493
Language en
Rights https://about.hal.science/hal-authorisation-v1/
contributor Graduate School of Mathematics [Nagoya] ; Nagoya University
creator Garrigue, Jacques
date 2013-12-07T00:00:00
harvest_object_id f5ec92ac-0c1c-4b34-9268-78fc94017bda
harvest_source_id 3374d638-d20b-4672-ba96-a23232d55657
harvest_source_title test moissonnage SELUNE
metadata_modified 2026-04-28T00:00:00
set_spec type:UNDEFINED