Ambivalent Types for Principal Type Inference with GADTs

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 :
Conference papers
Complete list of metadatas

Cited literature [16 references]  Display  Hide  Download

https://hal.inria.fr/hal-00914560
Contributor : Didier Rémy <>
Submitted on : Thursday, December 5, 2013 - 3:48:43 PM
Last modification on : Friday, May 25, 2018 - 12:02:07 PM
Long-term archiving on : Saturday, April 8, 2017 - 4:46:29 AM

File

Garrigue-Remy_gadts_applas2013...
Files produced by the author(s)

Identifiers

Collections

Citation

Jacques Garrigue, Didier Rémy. Ambivalent Types for Principal Type Inference with GADTs. APLAS 2013 - 11th Asian Symposium on Programming Languages and Systems, 2013, Melbourne, Australia. pp.257-272, ⟨10.1007/978-3-319-03542-0_19⟩. ⟨hal-00914560⟩

Share

Metrics

Record views

232

Files downloads

183