2014 · 22 citations · 23 references
ComputingComputer ScienceCompilersFormal MethodsProgramming LanguagesAbstract Syntax TreesCompiler ConstructionData TypesFunctional ProgrammingType CheckingType SystemsDatatypes TheoryPolymorphic TypesType ConstructorsType-level ProgrammingTyped Lambda Calculus
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.<br/><br/>We believe that delineating the mismatch between GHC's term level and its type level is a key step toward supporting dependently typed programming.
23
How to make ad-hoc polymorphism less ad hoc
Philip Wadler, Stephen Blott · 1989 · 770 citations · Full text
Definitional interpreters for higher-order programming languages
John Reynolds · 1972 · 668 citations
Template meta-programming for Haskell
Tim Sheard, Simon Peyton Jones · 2002 · 548 citations
Simple unification-based type inference for GADTs
Simon Peyton Jones, Dimitrios Vytiniotis, Stephanie Weirich et al. · 2006 · 336 citations
System F with type equality coercions
Martin Sulzmann, Manuel M. T. Chakravarty, Simon Peyton Jones et al. · 2007 · 239 citations