Changes between Version 17 and Version 18 of FunctionalDependencies
 Timestamp:
 Apr 10, 2006 1:15:30 AM (9 years ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

FunctionalDependencies
v17 v18 124 124 class C a b c  a > b where f :: a > b > c > Bool 125 125 126 instance B a b => C [a] [b]Bool126 instance B a b => C [a] b Bool 127 127 }}} 128 Given the constraint ``C [a] [b] Bool, C [a] [c]d``,129 * if we apply the dependency first, and then reduce using the instances, we obtain ``b = c, B a b, C [a] [b]d``.130 * if we first reduce using the instances, we obtain ``B a b, C [a] [c]d``.128 Given the constraint ``C [a] b Bool, C [a] c d``, 129 * if we apply the dependency first, and then reduce using the instances, we obtain ``b = c, B a b, C [a] b d``. 130 * if we first reduce using the instances, we obtain ``B a b, C [a] b d``. 131 131 (GHC and Hugs yield the former, because they defer context reduction: see FlexibleContexts). 132 132 … … 163 163 (In the above confluence example, `d` is instantiated to `Bool` and both alternatives reduce to {{{b = c, d = Bool, B a b}}}). 164 164 165 A restriction on instances to guarantee termination would also be needed.165 To guarantee termination, we would need to require that for any instance C t, each argument is either covered by t,,X,, or is a single variable.