[GHC] #8171: Extending ExtendedDefaultRules
GHC
ghc-devs at haskell.org
Sat Aug 24 20:33:53 UTC 2013
#8171: Extending ExtendedDefaultRules
------------------------------------+-------------------------------------
Reporter: ekmett | Owner:
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 7.6.3
Keywords: | Operating System: Unknown/Multiple
Architecture: Unknown/Multiple | Type of failure: None/Unknown
Difficulty: Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: |
------------------------------------+-------------------------------------
The current `ExtendedDefaultRules` 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.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/8171>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list