Abstract
Generalized Algebraic Data Types (GADT) are a popular programming language feature allowing advanced type-level properties to be encoded in the data types of a program. While Scala does not have direct support for them, GADT definitions can be encoded through Scala class hierarchies. Moreover, the Scala 3 compiler recently augmented its pattern matching capabilities to reason about such class hierarchies, making GADT-based programming practical in Scala. However, the current implementation can only reason about type parameters, but Scala's type system also features singleton types and abstract type members (collectively known as path-dependent types), about which GADT-style reasoning is also useful and important. In this paper, we show how we extended the existing constraint-based GADT reasoning of the Scala 3 compiler to also consider path-dependent types, making Scala's support for GADT programming more complete and bringing Scala closer to its formal foundations.
| Original language | English |
|---|---|
| Title of host publication | SCALA 2021 - Proceedings of the 12th ACM SIGPLAN International Symposium on Scala, co-located with SPLASH 2021 |
| Editors | Julien Richard-Foy, Sebastien Doeraene |
| Publisher | Association for Computing Machinery, Inc |
| Pages | 22-32 |
| Number of pages | 11 |
| ISBN (Electronic) | 9781450391139 |
| DOIs | |
| Publication status | Published - 17 Oct 2021 |
| Event | 12th ACM SIGPLAN International Symposium on Scala, SCALA 2021, co-located with SPLASH 2021 - Virtual, Online, United States Duration: 17 Oct 2021 → … |
Publication series
| Name | SCALA 2021 - Proceedings of the 12th ACM SIGPLAN International Symposium on Scala, co-located with SPLASH 2021 |
|---|
Conference
| Conference | 12th ACM SIGPLAN International Symposium on Scala, SCALA 2021, co-located with SPLASH 2021 |
|---|---|
| Country/Territory | United States |
| City | Virtual, Online |
| Period | 17/10/21 → … |
Bibliographical note
Publisher Copyright:© 2021 ACM.
Keywords
- Generalized algebraic data types
- Path-dependent types
- Scala
- Singleton types
- Type members
Fingerprint
Dive into the research topics of 'Implementing path-dependent GADT reasoning for Scala 3'. Together they form a unique fingerprint.Cite this
- APA
- Author
- BIBTEX
- Harvard
- Standard
- RIS
- Vancouver