GADTs are a very useful language feature that allow encoding some invariants in types. GADT reasoning is currently implemented in Scala and Dotty, but it’s plagued with soundness issues. To get a better understanding of GADTs in Scala, we explore how they can be encoded in pDOT, a calculus that is the formal foundation of the Scala programming language, and show a sketch of encoding a calculus containing GADTs to pDOT.
Martin Odersky, Olivier Eric Paul Blanvillain
Yichen Xu, Lionel Emile Vincent Parreaux, Aleksander Slawomir Boruch-Gruszecki