Backpack and instance defaults
[N.B. #17190 (closed) may be useful for some backstory.]
In Haskell today, if an associated type or data family has a default instance, hsig and hs-boot interfaces unconditionally opt-into that default. Unlike regular methods, the definition is meaningful for an abstract instance because we use it at the type level. And yes, that means with dependent Haskell we will have this problem regular methods too, when everything can be reasoned about equationally (#13149).
Also, in the short term interfaces don't support type families so this is extra bad because it means one cannot use defaults with interfaces at all, not just when they intend to declare an instance that doesn't necessary opt into the default. (symptom with defaults #17190 (closed), underlying issue with type families #8441).
Given all that, I think we should choose a syntax for opting in or out of defaults in signatures. I furthermore think we should choose it real soon because #8441 is said by @ezyang to be had to implement, and I'd like to resolve #17190 (closed) in both a forwards-compatible fashion without crossing that minefield.
I see two choices:
-
default foo, Foo
syntax to indicate a method (Type or term level) opts into a default. -
Deprecate default methods. It keeps on requiring new syntax (default sigs, this) and isn't as flexible as deriving-via. Fix any outstanding issues with deriving-via and default methods.