Extending ExtendedDefaultRules
The current ExtendedDefaultRules
(see manual page) is set up in a way that largely prevents it from being used for scenarios beyond what they get used for in GHCi today.
It would be great if there was an extra class that could be included in the list of acceptable classes for Rule 3.
class Defaulting a
The proposed change would be that Rule 3 under EDR can be be relaxed to: At least one of the classes Ci is numeric, or is Show
, Eq
, Ord
or Defaulting
.
I went with Defaulting
rather than Default
, because Default
is a common class in use across the ecosystem from the data-default
package, and I wanted to avoid gratuitous fallout.
This would permit projects like Shae Erisson's ghclive
from last year that need to use defaulting to not have to shoe-horn unnecessary Show
constraints onto functions.
Even better would be for that class to be polykinded!
That opens up possibilities for expert users to get defaulting to fire on arguments of other kinds, which is impossible under the current EDR.