Lune

POPL2022顶会

Staging with class: a specification for typed template Haskell

Ningning Xie, Matthew Pickering, Andres Löh, Nicolas Wu, Jeremy Yallop, Meng Wang

摘要

Multi-stage programming using typed code quotation is an established technique for writing optimizing code generators with strong type-safety guarantees. Unfortunately, quotation in Haskell interacts poorly with type classes, making it difficult to write robust multi-stage programs.

We study this unsound interaction and propose a resolution, staged type class constraints, which we formalize in a source calculus 𝜆 ⇒ that elaborates into an explicit core calculus 𝐹 . We show type soundness of both calculi, establishing that well-typed, well-staged source programs always elaborate to well-typed, well-staged core programs, and prove beta and eta rules for code quotations.

Our design allows programmers to incorporate type classes into multi-stage programs with confidence. Although motivated by Haskell, it is also suitable as a foundation for other languages that support both overloading and quotation.

问 Lune

几分钟读透这篇 Paper,不用再花一下午。

Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。

已有 4 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。

可以从这些问题问起

Lune 可以查阅

全文 · 引用它的顶会 Paper · 相关的 Paper

获取答案

免费开始,无需绑卡

脉络

  • Mechanised Semantics of Multi-stage Programming 引用了 Handling Scope Checks: A Comparative Framework for Dynamic Scope Extrusion Checks
它引用的引用它的从左到右按年份排列,引用越多,位置越高。

引用它的顶会 Paper4

  1. Handling Scope Checks: A Comparative Framework for Dynamic Scope Extrusion ChecksMichael Lee, Ningning Xie, Oleg Kiselyov, Jeremy YallopPOPL 2026 · 3 次引用
  2. Mechanised Semantics of Multi-stage ProgrammingKa Wing Li, Maite Kramarz, Ningning Xie, Jeremy YallopOOPSLA 2026 · 1 次引用
  3. Contextual MetaML: Syntax and Full AbstractionHaoxuan Yin, Andrzej S. Murawski, C.-H. Luke OngLICS 2026 · 1 次引用
  4. When Do Staging Annotations Preserve Semantics? Mechanizing Typed Semantics-Preserving Multi-stage Programming with Let-InsertionJun Tan, Guannan WeiOOPSLA 2026

它引用的 Paper1

  1. Multimodal Dependent Type TheoryDaniel Gratzer, G. A. Kavvos, Andreas Nuyts, Lars BirkedalLICS 2020 · 36 次引用

相关 Paper

  1. Refined² Environment ClassifiersYuito Murase, Atsushi IgarashiOOPSLA 2026
  2. Type Inference LogicsDenis Carnier, François Pottier, Steven KeuchelOOPSLA 2024 · 3 次引用
  3. Extensible Data Types with Ad-Hoc PolymorphismMatthew Toohey, Yanning Chen, Ara Jamalzadeh, Ningning XiePOPL 2026 · 1 次引用
  4. Partial type constructors: or, making ad hoc datatypes less ad hocMark P. Jones, J. Garrett Morris, Richard A. EisenbergPOPL 2020 · 1 次引用
  5. Resolution as intersection subtyping via Modus PonensKoar Marntirosian, Tom Schrijvers, Bruno C. d. S. Oliveira, Georgios KarachaliasOOPSLA 2020 · 5 次引用
黄昏的海面,两侧是细线勾勒的悬崖