Bidirectional Type Class Instances

Autor: Koen Pauwels, Tom Schrijvers, Michiel Derhaeg, Georgios Karachalias
Přispěvatelé: Eisenberg, RA
Rok vydání: 2019
Předmět:
Zdroj: Haskell@ICFP
Popis: GADTs were introduced in Haskell's eco-system more than a decade ago, but their interaction with several mainstream features such as type classes and functional dependencies has a lot of room for improvement. More specifically, for some GADTs it can be surprisingly difficult to provide an instance for even the simplest of type classes. In this paper we identify the source of this shortcoming and address it by introducing a conservative extension to Haskell's type classes: {\em Bidirectional Type Class Instances}. In essence, under our interpretation class instances correspond to logical bi-implications, in contrast to their traditional unidirectional interpretation. We present a fully-fledged design of bidirectional instances, covering the specification of typing and elaboration into System FC, as well as an algorithm for type inference and elaboration. We provide a proof-of-concept implementation of our algorithm, and revisit the meta-theory of type classes in the presence of our extension. ispartof: pages:30-43 ispartof: PROCEEDINGS OF THE 12TH ACM SIGPLAN INTERNATIONAL SYMPOSIUM ON HASKELL (HASKELL '19) vol:53 pages:30-43 ispartof: 12th ACM SIGPLAN International Symposium on Haskell (Haskell) location:GERMANY, Berlin date:22 Aug - 23 Aug 2019 status: published
Databáze: OpenAIRE