[Git][ghc/ghc][master] Implements the Exportable Named Default proposal (#24305)

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Sat Aug 17 17:57:56 UTC 2024



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
fa0dbaca by Mario Blažević at 2024-08-17T03:31:32+00:00
Implements the Exportable Named Default proposal (#24305)

This squashed commit adds support for exportable named defaults, the accepted
GHC proposal at https://github.com/ghc-proposals/ghc-proposals/pull/409

The proposal extends the Haskell '98 declarations

    default (Int, Double)

which were implicitly always applying to Num class alone, to allow specifying
an arbitrary single-parameter class:

    default IsString (Text, String)

The effect of this declaration would be to eliminate the ambiguous type errors
around string literals when OverloadedStrings extension is active. The
declaration by itself has effect only in its module, so the proposal also adds
the ability to export class defaults:

    module MyModule (default IsIstring)

Once the language extension is published and established, we can consider using
it in base and other libraries.

See Note [Named default declarations] in GHC.Tc.Gen.Default
for implementation details.

- - - - -


30 changed files:

- compiler/GHC/CoreToIface.hs
- compiler/GHC/Driver/Flags.hs
- compiler/GHC/Hs/Decls.hs
- compiler/GHC/Hs/ImpExp.hs
- compiler/GHC/HsToCore.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Iface/Load.hs
- compiler/GHC/Iface/Make.hs
- compiler/GHC/Iface/Syntax.hs
- compiler/GHC/Iface/Tidy.hs
- compiler/GHC/IfaceToCore.hs
- compiler/GHC/IfaceToCore.hs-boot
- compiler/GHC/Parser.y
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Rename/Names.hs
- compiler/GHC/Runtime/Context.hs
- compiler/GHC/Tc/Deriv.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/Default.hs
- compiler/GHC/Tc/Gen/Export.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Module.hs
- compiler/GHC/Tc/Solver.hs
- compiler/GHC/Tc/Solver/Monad.hs
- compiler/GHC/Tc/Types.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Utils/Backpack.hs
- compiler/GHC/Tc/Utils/Env.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fa0dbaca6cc78bf626ce9038f347bdf388839fa5

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fa0dbaca6cc78bf626ce9038f347bdf388839fa5
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240817/112410fb/attachment-0001.html>


More information about the ghc-commits mailing list