Kind Inference for Datatypes: Technical Supplement

11/12/2019
by   Ningning Xie, et al.
0

In recent years, languages like Haskell have seen a dramatic surge of new features that significantly extends the expressive power of their type systems. With these features, the challenge of kind inference for datatype declarations has presented itself and become a worthy research problem on its own. This paper studies kind inference for datatypes. Inspired by previous research on type-inference, we offer declarative specifications for what datatype declarations should be accepted, both for Haskell98 and for a more advanced system we call PolyKinds, based on the extensions in modern Haskell, including a limited form of dependent types. We believe these formulations to be novel and without precedent, even for Haskell98. These specifications are complemented with implementable algorithmic versions. We study soundness, completeness and the existence of principal kinds in these systems, proving the properties where they hold. This work can serve as a guide both to language designers who wish to formalize their datatype declarations and also to implementors keen to have principled inference of principal types. 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).

READ FULL TEXT

page 1

page 2

page 3

page 4

research
10/21/2020

On the Semantic Expressiveness of Recursive Types

Recursive types extend the simply-typed lambda calculus (STLC) with the ...
research
08/01/2019

Refinement Kinds: Type-safe Programming with Practical Type-level Computation (Extended Version)

This work introduces the novel concept of kind refinement, which we deve...
research
04/13/2023

Kind Inference for the FreeST Programming Language

We present a kind inference algorithm for the FREEST programming languag...
research
07/20/2022

Constraint-based type inference for FreezeML

FreezeML is a new approach to first-class polymorphic type inference tha...
research
07/25/2017

An Executable Specification of Typing Rules for Extensible Records based on Row Polymorphism

Type inference is an application domain that is a natural fit for logic ...
research
07/02/2021

Dependent Type Systems as Macros

We present Turnstile+, a high-level, macros-based metaDSL for building d...
research
11/01/2019

A Modular Inference of Linear Types for Multiplicity-Annotated Arrows

Bernardy et al. [2018] proposed a linear type system λ^q_→ as a core typ...

Please sign up or login with your details

Forgot password? Click here to reset