Refinement Kinds: Type-safe Programming with Practical Type-level Computation (Extended Version)
Lu\'is Caires, Bernardo Toninho

TL;DR
This paper introduces kind refinement, a novel approach to type specifications in a polymorphic language, enabling rich type manipulations and meta-programming with formal safety guarantees.
Contribution
It develops the concept of kind refinement, allowing rich kind specifications and advanced type manipulations in a type-safe, ML-like language.
Findings
Formal proof of type safety
Prototype implementation of kind and type checkers
Enhanced expressiveness for type reflection and meta-programming
Abstract
This work introduces the novel concept of kind refinement, which we develop in the context of an explicitly polymorphic ML-like language with type-level computation. Just as type refinements embed rich specifications by means of comprehension principles expressed by predicates over values in the type domain, kind refinements provide rich kind specifications by means of predicates over types in the kind domain. By leveraging our powerful refinement kind discipline, types in our language are not just used to statically classify program expressions and values, but also conveniently manipulated as tree-like data structures, with their kinds refined by logical constraints on such structures. Remarkably, the resulting typing and kinding disciplines allow for powerful forms of type reflection, ad-hoc polymorphism and type meta-programming, which are often found in modern software development,…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsLogic, programming, and type systems · Software Engineering Research · Advanced Software Engineering Methodologies
