Repository logo

Infoscience

  • English
  • French
Log In
Logo EPFL, École polytechnique fédérale de Lausanne

Infoscience

  • English
  • French
Log In
  1. Home
  2. Academic and Research Output
  3. Journal articles
  4. A case for DOT: Theoretical Foundations for Objects with Pattern Matching and GADT-Style Reasoning
 
research article

A case for DOT: Theoretical Foundations for Objects with Pattern Matching and GADT-Style Reasoning

Boruch-Gruszecki, Aleksander Slawomir  
•
Wasko, Radoslaw
•
Xu, Yichen  
Show more
October 1, 2022
Proceedings Of The Acm On Programming Languages-Pacmpl

Many programming languages in the OO tradition now support pattern matching in some form. Historical examples include Scala and Ceylon, with the more recent additions of Java, Kotlin, TypeScript, and Flow. But pattern matching on generic class hierarchies currently results in puzzling type errors in most of these languages. Yet this combination of features occurs naturally in many scenarios, such as when manipulating typed ASTs. To support it properly, compilers needs to implement a form of subtyping reconstruction: the ability to reconstruct subtyping information uncovered at runtime during pattern matching. We introduce cDOT, a new calculus in the family of Dependent Object Types (DOT) intended to serve as a formal foundation for subtyping reconstruction. Being descended from pDOT, itself a formal foundation for Scala, cDOT can be used to encode advanced object-oriented features such as generic inheritance, type constructor variance, F-bounded polymorphism, and first-class recursive modules. We demonstrate that subtyping reconstruction subsumes GADTs by encoding lambda(2,G mu), a classical constraint-based GADT calculus, into cDOT.

  • Details
  • Metrics
Type
research article
DOI
10.1145/3563342
Web of Science ID

WOS:001083750200056

Author(s)
Boruch-Gruszecki, Aleksander Slawomir  
Wasko, Radoslaw
Xu, Yichen  
Parreaux, Lionel
Date Issued

2022-10-01

Publisher

Assoc Computing Machinery

Published in
Proceedings Of The Acm On Programming Languages-Pacmpl
Volume

6

Issue

OOPSLA

Start page

179

Subjects

Technology

•

Dot

•

Pattern Matching

•

Gadt

•

Classes

•

Type Systems

Editorial or Peer reviewed

REVIEWED

Written at

EPFL

EPFL units
LAMP1  
Available on Infoscience
February 16, 2024
Use this identifier to reference this record
https://infoscience.epfl.ch/handle/20.500.14299/203862
Logo EPFL, École polytechnique fédérale de Lausanne
  • Contact
  • infoscience@epfl.ch

  • Follow us on Facebook
  • Follow us on Instagram
  • Follow us on LinkedIn
  • Follow us on X
  • Follow us on Youtube
AccessibilityLegal noticePrivacy policyCookie settingsEnd User AgreementGet helpFeedback

Infoscience is a service managed and provided by the Library and IT Services of EPFL. © EPFL, tous droits réservés