Truly abstract interfaces for algebraic data types: the extractor typing problem

Pattern matching enables inspecting algebraic data types, but typically prevents hiding the implementation of the matched algebraic data type. In Scala, instead, extractors also allow pattern matching on non-algebraic data types and invoking methods on the obtained objects, while partially decoupling API consumers from the API implementation. But as we show in this paper, pattern matching using extractors is restricted compared to matching against case classes. We argue this violates the appropriate variant of the uniform access principle. To address this problem, we propose a small language extension, which enables defining truly abstract interfaces and freely evolve their implementation.


Publié dans:
Proceedings of the 9th ACM SIGPLAN International Symposium on Scala
Présenté à:
Scala 2018, St. Louis, Missouri, USA, September 28-28, 2018
Année
Sep 28 2018
Mots-clefs:
Laboratoires:


Note: Le statut de ce fichier est: Seulement EPFL


 Notice créée le 2018-11-27, modifiée le 2019-06-19

POSTPRINT:
Télécharger le document
PDF

Évaluer ce document:

Rate this document:
1
2
3
 
(Pas encore évalué)