Affiliation:
1. University of Pennsylvania, Philadelphia, PA, USA
2. Politechnika Łódzka, Łódzka, Poland
Abstract
Haskell, as implemented in the Glasgow Haskell Compiler (GHC), is enriched with many extensions that support type-level programming, such as promoted datatypes, kind polymorphism, and type families. Yet, the expressiveness of the type-level language remains limited. It is missing many features present at the term level, including
case
expressions, anonymous functions, partially-applied functions, and
let
expressions. In this paper, we present an algorithm - with a proof of correctness - to encode these term-level constructs at the type level. Our approach is automated and capable of promoting a wide array of functions to type families. We also highlight and discuss those term-level features that are not promotable. In so doing, we offer a critique on GHC's existing type system, showing what it is already capable of and where it may want improvement.
We believe that delineating the mismatch between GHC's term level and its type level is a key step toward supporting dependently typed programming.
Funder
National Science Foundation
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Cited by
3 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Chesskell: a two-player game at the type level;Proceedings of the 14th ACM SIGPLAN International Symposium on Haskell;2021-08-18
2. Graded monads and type-level programming for dependence analysis;Proceedings of the 14th ACM SIGPLAN International Symposium on Haskell;2021-08-18
3. Optional Type Classes for Haskell;Programming Languages;2016