1. Understanding functional dependencies via constraint handling rules
- Author
-
Simon Peyton-Jones, Gregory J. Duck, Martin Sulzmann, and Peter J. Stuckey
- Subjects
Constraint Handling Rules ,Theoretical computer science ,Armstrong's axioms ,Computer science ,Programming language ,Type inference ,Context (language use) ,computer.software_genre ,Decidability ,Dependency theory (database theory) ,Haskell ,Functional dependency ,computer ,Software ,computer.programming_language - Abstract
Functional dependencies are a popular and useful extension to Haskell style type classes. We give a reformulation of functional dependencies in terms of Constraint Handling Rules (CHRs). In previous work, CHRs have been employed for describing user-programmable type extensions in the context of Haskell style type classes. Here, we make use of CHRs to provide for the first time a concise result that under some sufficient conditions, functional dependencies allow for sound, complete and decidable type inference. The sufficient conditions imposed on functional dependencies can be very limiting. We show how to safely relax these conditions and suggest several sound extensions of functional dependencies. Our results allow for a better understanding of functional dependencies and open up the opportunity for new applications.
- Published
- 2007
- Full Text
- View/download PDF