Skip to Main content Skip to Navigation
Preprints, Working Papers, ...

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

Abstract : 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.
Document type :
Preprints, Working Papers, ...
Complete list of metadata
Contributor : Didier Rémy Connect in order to contact the contributor
Submitted on : Friday, December 6, 2013 - 4:27:23 PM
Last modification on : Friday, May 25, 2018 - 12:02:07 PM
Long-term archiving on: : Saturday, April 8, 2017 - 4:46:01 AM


Files produced by the author(s)


  • HAL Id : hal-00914493, version 1


Jacques Garrigue, Didier Rémy. Ambivalent Types for Principal Type Inference with GADTs (extended version). 2013. ⟨hal-00914493v1⟩



Record views


Files downloads