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 → ⋆.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper2
- Verifying replicated data types with typeclass refinements in Liquid HaskellYiyun Liu, James Parker, Patrick Redmond, Lindsey Kuper 等OOPSLA 2020 · 被引用 24 次
- Practical Type Inference with LevelsAndong Fan, Han Xu, Ningning XiePLDI 2025 · 被引用 3 次
相关 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
- Greedy Implicit Bounded QuantificationChen Cui, Shengyi Jiang, Bruno C. d. S. OliveiraOOPSLA 2023 · 被引用 9 次
- Let Generalization, Polymorphic Recursion, and Variable Minimization in Boolean-Kinded Type SystemsJoseph A. ZulloPOPL 2026 · 被引用 1 次
