Kind inference for datatypes
Ningning Xie, Richard A. Eisenberg, Bruno C. d. S. Oliveira
摘要
This technical supplement to Kind Inference for Datatypes serves to expand upon the text in the main paper. It contains detailed typing rules, proofs, and connections to the Glasgow Haskell Compiler (GHC). Sections in this document are meant to connect to sections in the main paper. There are many hyperlinks throughout, especially those highlighting the connections to GHC; you may wish to read on a computer instead of on paper.
This section accompanies Section 8 of the main paper, including discussion about more related language extensions. These extensions affect kind inference, but not in a fundamental way.
Besides specified type variables for which users can optionally provide type arguments, Haskell also incorporates visible dependent quantification (VDQ) 1 , e.g., type T :: ∀(k :: ⋆) → k → ⋆, with which users are forced to provide type arguments to T . That is, one would use T with, e.g., T ⋆ Int and T (⋆ → ⋆) Maybe, never just T Int. Visible dependent quantification is Haskell's equivalent to routine dependent quantification in dependently typed languages.
To support VDQ, rule dt-tt needs to be extended, as VDQ brings variables into scope for later reference. For example, given type T :: ∀(k :: ⋆) → k → ⋆ data T k a = MkT We should get a context k :: ⋆, a :: k when checking MkT .
VDQ opens an interesting design choice: should unannotated type variables be able to introduce VDQ? For example, in the definition of P below, we use f and a as the arguments to T . To make it type-check, we need to infer P :: ∀(f :: ⋆) → f → ⋆.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 2 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
引用它的顶会 Paper2
相关 Paper
- Encode the Cake and Eat It Too: Controlling Computation in Type Theory, LocallyYann Leray, Théo WinterhalterPOPL 2026
- Partial type constructors: or, making ad hoc datatypes less ad hocMark P. Jones, J. Garrett Morris, Richard A. EisenbergPOPL 2020 · 1 次引用
- Bounded Sort Polymorphism with Elimination ConstraintsJohann Rosain, Tomás Díaz, Kenji Maillard, Matthieu Sozeau 等POPL 2026
- Let Generalization, Polymorphic Recursion, and Variable Minimization in Boolean-Kinded Type SystemsJoseph A. ZulloPOPL 2026 · 1 次引用
- Greedy Implicit Bounded QuantificationChen Cui, Shengyi Jiang, Bruno C. d. S. OliveiraOOPSLA 2023 · 9 次引用
