Elaboration on functional dependencies: functional dependencies are dead, long live functional dependencies!

Autor: Tom Schrijvers, Georgios Karachalias
Přispěvatelé: Diatchki, Iavor S
Rok vydání: 2017
Předmět:
Zdroj: Proceedings of the 10th ACM SIGPLAN International Symposium on Haskell -Haskell 2017
Proceedings of the 10th ACM SIGPLAN International Symposium on Haskell-Haskell 2017
Proceedings of the 10th ACM SIGPLAN International Symposium on Haskell
Haskell
DOI: 10.1145/3122955.3122966
Popis: Functional dependencies are a popular extension to Haskell's type-class system because they provide fine-grained control over type inference, resolve ambiguities and even enable type-level computations. Unfortunately, several aspects of Haskell's functional dependencies are ill-understood. In particular, the GHC compiler does not properly enforce the functional dependency property, and rejects well-typed programs because it does not know how to elaborate them into its core language, System F C . This paper presents a novel formalization of functional dependencies that addresses these issues: We explicitly capture the functional dependency property in the type system, in the form of explicit type equalities. We also provide a type inference algorithm and an accompanying elaboration strategy which allows all well-typed programs to be elaborated into System F C .
Databáze: OpenAIRE