49 | 49 | If (1) succeeds but (2) fails, the alternative is in accessible. Of course, (2) might fail "later" by generating a constraint that later can't be satisfied, and we won't report that well, but we'd get a good message in the common fails-fast case. We could even improve the message from (1) to say: "Constructor C is from data type T, but a pattern of type s is expected. |

50 | 50 | 0. `substEqInDict` needs to be symmetric (i.e., also apply right-to-left rules); try to re-use existing infrastructure. It would be neater, easier to understand, and more efficient to have one loop that goes for a fixed point of simultaneously rewriting with given_eqs, wanted_eqs, and type instances. |

51 | | 0. skolemOccurs for wanteds? At least `F a ~ [G (F a)]` and similar currently result in an occurs check error. Without skolemOccurs in wanted, the occurs check for wanted would need to be smarter (and just prevent cyclic substitutions of the outlined form silently). However, when inferring a type, having the rewrites enabled by skolemOccurs available will leads to potentially simpler contexts. |

| 51 | 0. skolemOccurs for wanteds? At least `F a ~ [G (F a)]` and similar currently result in an occurs check error. Without skolemOccurs in wanted, the occurs check for wanted would need to be smarter (and just prevent cyclic substitutions of the outlined form silently). However, when inferring a type, having the rewrites enabled by skolemOccurs available will leads to potentially simpler contexts. As an example consider |

| 52 | {{{ |

| 53 | type family F x |

| 54 | type instance F [x] = [F x] |

| 55 | |

| 56 | t :: a -> a -> Bool |

| 57 | t _ _ = True |

| 58 | |

| 59 | f :: a -> F [a] |

| 60 | f = undefined |

| 61 | |

| 62 | test :: ([F a] ~ a) => a -> Bool |

| 63 | test x = t x (f x) |

| 64 | }}} |

| 65 | It is reject if the signature for `test` is present, but accepted if the signature is omitted (and inferred). |