NamedDefaults: implementation should not prevent tyvars appearing in non-unary constraints from being defaultable
GHC proposal #409 relaxed the rules for defaulting at use-sites. However, the implementation doesn't match the specification, as GHC.Tc.Solver.Default.findDefaultableGroups
still considers any type variable that appears in a non-unary constraint to be non-defaultable.
So we should either:
- Remove that check entirely, or
- Remove that check when
-XNamedDefaults
is enabled. Note that this check is already skipped when-XExtendedDefaultRules
is enabled.
(2) seems like the easier sell, but I still find it quite strange that enabling/disabling the extension would affect this case (non-unary constraints) when the rest of the logic (such as defaulting non-standard classes) is not gated at all (see my analysis in this comment).
See also
Edited by Simon Peyton Jones