A Specification for Typed Template Haskell

Multi-stage programming is a proven technique that provides predictable performance characteristics by controlling code generation.We propose a core semantics for TypedTemplateHaskell, an extension ofHaskell that supports multi staged programming that interacts well with polymorphism and qualified types. Our semantics relates a declarative source language with qualified types to a core language based on the the polymorphic lambda calculus augmented with multi-stage constructs.

[1]  Walid Taha,et al.  A Gentle Introduction to Multi-stage Programming , 2003, Domain-Specific Program Generation.

[2]  Simon L. Peyton Jones,et al.  Template meta-programming for Haskell , 2002, Haskell '02.

[3]  Conor McBride,et al.  Inductive Families Need Not Store Their Indices , 2003, TYPES.

[4]  Luca Cardelli,et al.  Phase Distinctions in Type Theory , 1988 .

[5]  Ranald Clouston,et al.  Fitch-Style Modal Lambda Calculi , 2017, FoSSaCS.

[6]  Rasmus Ejlers Møgelberg,et al.  Simply RaTT: a fitch-style modal calculus for reactive programming without space leaks , 2019, Proc. ACM Program. Lang..

[7]  Aleksandar Nanevski Meta-programming with names and necessity , 2002, ICFP '02.

[8]  Simon L. Peyton Jones,et al.  A quick look at impredicativity , 2020, Proc. ACM Program. Lang..

[9]  Stephanie Weirich,et al.  A specification for dependent types in Haskell , 2017, Proc. ACM Program. Lang..

[10]  Nicolas Wu,et al.  Working with source plugins , 2019, Haskell@ICFP.

[11]  Simon L. Peyton Jones,et al.  Type classes in Haskell , 1994, TOPL.

[12]  Simon Peyton Jones,et al.  Type classes: an exploration of the design space , 1997 .

[13]  Edwin Brady,et al.  A verified staged interpreter is a verified compiler , 2006, GPCE '06.

[14]  Nicolas Wu,et al.  Staged selective parser combinators , 2020, Proc. ACM Program. Lang..

[15]  Martin Odersky,et al.  A practical unification of multi-stage programming and macros , 2018, GPCE.

[16]  Nicolas Wu,et al.  Multi-stage programs in context , 2019, Haskell@ICFP.

[17]  VytiniotisDimitrios,et al.  Practical type inference for arbitrary-rank types , 2007 .

[18]  Oleg Kiselyov Generating Code with Polymorphic let: A Ballad of Value Restriction, Copying and Sharing , 2015, ML Family/OCaml.

[19]  Frank Pfenning,et al.  A modal analysis of staged computation , 1996, POPL '96.

[20]  Ohad Kammar,et al.  Partially-static data as free extension of algebras , 2018, Proc. ACM Program. Lang..

[21]  Thierry Coppey,et al.  Staged parser combinators for efficient data processing , 2014, OOPSLA.

[22]  Simon L. Peyton Jones,et al.  OutsideIn(X) Modular type inference with local assumptions , 2011, J. Funct. Program..

[23]  Walid Taha,et al.  MetaML and multi-stage programming with explicit annotations , 2000, Theor. Comput. Sci..

[24]  Walid Taha,et al.  Concoqtion: indexed types now! , 2007, PEPM '07.

[25]  Johan Jeuring,et al.  A generic deriving mechanism for Haskell , 2010, Haskell '10.

[26]  Jeremy Yallop,et al.  Staged generic programming , 2017, Proc. ACM Program. Lang..

[27]  Simon L. Peyton Jones,et al.  Guarded impredicative polymorphism , 2018, PLDI.

[28]  Frank Pfenning,et al.  Intensionality, extensionality, and proof irrelevance in modal type theory , 2001, Proceedings 16th Annual IEEE Symposium on Logic in Computer Science.

[29]  Lars Birkedal,et al.  Implementing a modal dependent type theory , 2019, Proc. ACM Program. Lang..

[30]  Dominique Devriese,et al.  Degrees of Relatedness: A Unified Framework for Parametricity, Irrelevance, Ad Hoc Polymorphism, Intersections, Unions and Algebra in Dependent Type Theory , 2018, LICS.

[31]  Jeremy Yallop,et al.  A typed, algebraic approach to parsing , 2019, PLDI.

[32]  Adam Michael Gundry,et al.  Type inference, Haskell and dependent types , 2013 .

[33]  Martin Odersky,et al.  Lightweight modular staging: a pragmatic approach to runtime code generation and compiled DSLs , 2010, GPCE '10.

[34]  Simon L. Peyton Jones,et al.  Linear Haskell: practical linearity in a higher-order polymorphic language , 2017, Proc. ACM Program. Lang..

[35]  Bruno C. d. S. Oliveira,et al.  Comparing libraries for generic programming in haskell , 2008, Haskell '08.

[36]  Emir Pasalic,et al.  The role of type equality in meta-programming , 2004 .

[37]  Alexander Simpson Workshop on Types for Proofs and Programs , 1993 .

[38]  Walid Taha,et al.  Implementing Multi-stage Languages Using ASTs, Gensym, and Reflection , 2003, GPCE.

[39]  Walid Taha,et al.  Tagless staged interpreters for typed languages , 2002, ICFP '02.

[40]  Richard A. Eisenberg,et al.  Dependent Types in Haskell: Theory and Practice , 2016, ArXiv.

[41]  Oleg Kiselyov Reconciling Abstraction with High Performance: A MetaOCaml approach , 2018, Found. Trends Program. Lang..

[42]  Simon L. Peyton Jones,et al.  Scrap Your Type Applications , 2008, MPC.

[43]  Akira Kawata,et al.  A Dependently Typed Multi-Stage Calculus , 2019, APLAS.

[44]  Bruno C. d. S. Oliveira,et al.  Quantified class constraints , 2017, Haskell.

[45]  Walid Taha,et al.  Multi-stage programming with explicit annotations , 1997, PEPM.

[46]  Yukiyoshi Kameyama,et al.  Polymorphic Multi-stage Language with Control Effects , 2011, APLAS.