Changes between Version 22 and Version 23 of FunctionalDependencies
 Timestamp:
 Apr 19, 2006 10:54:19 PM (10 years ago)
Legend:
 Unmodified
 Added
 Removed
 Modified

FunctionalDependencies
v22 v23 83 83 (This rule is justified by the above "consistency" condition.) 84 84 85 === Interaction with superclasses === 86 87 The original version makes no changes to the treatment of superclasses, so given the classes (sect. 7) 88 {{{ 89 class U a b  a > b 90 class U a b => V a b 91 }}} 92 the constraint set {{{U a b, V a c}}} is irreducible. 93 (Adding a dependency to V does not change this.) 94 In GHC and Hugs, and the system studied in DFCHR, the improvement rules are applied to the closure of the constraint set under superclasses. 95 In this example, that is {{{U a b, U a c, V a c}}}, so the functional dependency implies {{{b = c}}}. 96 (This example can also be rearranged to show nonconfluence for the original system.) 97 85 98 === Properties === 86 99 87 With FlexibleInstances and no OverlappingInstances, this system is coherent and decidable (CHR paper, corr. 1).100 * With FlexibleInstances and no OverlappingInstances, this system is coherent and decidable (CHR paper, corr. 1). 88 101 89 Unfortunately the "coverage" condition rules out instances like the following, from the monad transformer library:90 {{{102 * Unfortunately the "coverage" condition rules out instances like the following, from the monad transformer library: 103 {{{ 91 104 class (Monoid w, Monad m) => MonadWriter w m  m > w 92 instance MonadWriter w m => MonadWriter w (ReaderT rm)105 instance (Error e, MonadWriter w m) => MonadWriter w (ErrorT e m) 93 106 }}} 94 107 … … 153 166 * the functional dependency is ''full'' (involves all the arguments of the class), and the arguments t,,Y,, are distinct type variables determined by the free variables of t,,X,,. 154 167 155 The fullness condition restores confluence, while the variable argument condition restores termination .168 The fullness condition restores confluence, while the variable argument condition restores termination (by making instance improvement trivial). 156 169 157 170 Note that functional dependencies corresponding to [wiki:AssociatedTypes associated type synonyms] are always full.