[Haskell-cafe] Generalized, named, and exportable default declarations (GHC Proposal)

Eric Seidel eric at seidel.io
Tue Apr 13 00:54:37 UTC 2021


Hi Cafe,

The GHC Steering Committee is considering a proposal that would expand the typeclass defaulting mechanism to support arbitrary (single-parameter) classes, and enable exporting defaulting rules.

It's received very little input from the community so far, which is a shame because it's trying to address a common complaint about Haskell's String situation. Under the proposal Data.Text could export a rule defaulting IsString to Text. Client modules would automatically import defaulting rules just like class instances, which would make ambiguous string literals automatically default to Text.

Please take a look at the proposal and leave your feedback, even if it's just "Yes, this would make my life meaningfully better" (reaction emoji are great for this level of feedback). Gauging the amount of pain caused by problems like this, and weighing that against the cost of new features, is one of the harder parts of being on the Committee.

PR: https://github.com/ghc-proposals/ghc-proposals/pull/409
Rendered: https://github.com/blamario/ghc-proposals/blob/exportable-named-default/proposals/0000-exportable-named-default.rst


More information about the Haskell-Cafe mailing list