[Git][ghc/ghc][wip/instd-quantifications] TH: handle explicit quantification in instances

sheaf (@sheaf) gitlab at gitlab.haskell.org
Tue Jan 31 10:41:30 UTC 2023



sheaf pushed to branch wip/instd-quantifications at Glasgow Haskell Compiler / GHC


Commits:
5da40ae1 by sheaf at 2023-01-31T11:41:04+01:00
TH: handle explicit quantification in instances

This patch adds support for explicitly-written quantification in
typeclass instances, such as:

  instance forall k (a :: k). C a
  deriving instance forall k (a :: k). D a

It does so by adding a field of type `Maybe (TyVarBndr ())`
to both the `InstanceD` and `StandaloneDerivD` constructors of the
Template Haskell `Dec` datatype, and making appropriate use of it to
ensure that spliced declarations don't silently drop the user-written
quantification.

Fixes #21794

Updates haddock submodule

- - - - -


30 changed files:

- compiler/GHC/Builtin/Names/TH.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/Rename/Module.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Var.hs
- docs/users_guide/9.8.1-notes.rst
- libraries/template-haskell/Language/Haskell/TH/Lib.hs
- libraries/template-haskell/Language/Haskell/TH/Lib/Internal.hs
- libraries/template-haskell/Language/Haskell/TH/Ppr.hs
- libraries/template-haskell/Language/Haskell/TH/Syntax.hs
- libraries/template-haskell/changelog.md
- testsuite/tests/ghci/scripts/T4127.stdout
- testsuite/tests/safeHaskell/safeLanguage/SafeLang11_B.hs
- testsuite/tests/safeHaskell/safeLanguage/SafeLang12_B.hs
- testsuite/tests/th/T11629.hs
- testsuite/tests/th/T14888.stderr
- testsuite/tests/th/T1835.stdout
- + testsuite/tests/th/T21794.hs
- + testsuite/tests/th/T21794.stderr
- testsuite/tests/th/T5452.hs
- testsuite/tests/th/T5700a.hs
- testsuite/tests/th/T5886a.hs
- testsuite/tests/th/T7064.stdout
- testsuite/tests/th/T7532a.hs
- testsuite/tests/th/T8100.hs
- testsuite/tests/th/T8625.stdout
- testsuite/tests/th/T8761.stderr
- testsuite/tests/th/T8953.stderr


The diff was not included because it is too large.


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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5da40ae13359f4fac3dfe5ff30ac33c469b730d5
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/20230131/a3639175/attachment.html>


More information about the ghc-commits mailing list