This is the root page for examples and issues about functional dependencies in GHC.
IMPORTANT This list of sub-pages have most of the content!
The rest this page gathers other useful links.
- Type classes with functional dependencies, Mark Jones, ESOP 2000. The original fundep paper.
- Understanding functional dependencies via constraint handling rules, Sulzmann et al, JFP 2006. This journal paper has a lot of examples and we cite it frequently below as "JFP-paper".
- Elaboration on functional dependencies, Karachalias and Schrijvers, Haskell Symposium 2017. This paper shows how to translate functional dependencies into type families.
- Evidenced functional dependencies a wiki page developing the Karachalias and Schrijvers paper further.
- Coverage condition: Per-instance DYSFUNCTIONAL pragma.
- Instance consistency condition: Explore ways to weaken or abandon the Instance Consistency Condition.
GHC today does this:
By default: GHC uses the strict coverage condition and imposes the Paterson conditions.
UndecidableInstancesis on, GHC
- uses the liberal (not strict) coverage condition
- lifts the Paterson conditions
Always: GHC implements liberal instance consistency unconditionally. See
Note [Bogus consistency check]in
GHC.Tc.Instance.Fundeps. (GHC presumably does this because SICC is incompatible with LCC.)