[Git][ghc/ghc][wip/haddock-optimizations] 4 commits: Visible forall in types of terms: Part 1 (#22326)

Matthew Pickering (@mpickering) gitlab at gitlab.haskell.org
Mon Jul 24 08:21:20 UTC 2023



Matthew Pickering pushed to branch wip/haddock-optimizations at Glasgow Haskell Compiler / GHC


Commits:
33b6850a by Vladislav Zavialov at 2023-07-23T10:27:37-04:00
Visible forall in types of terms: Part 1 (#22326)

This patch implements part 1 of GHC Proposal #281,
introducing explicit `type` patterns and `type` arguments.

Summary of the changes:

1. New extension flag:
     RequiredTypeArguments

2. New user-facing syntax:
     `type p` patterns    (represented by EmbTyPat)
     `type e` expressions (represented by HsEmbTy)

3. Functions with required type arguments (visible forall)
   can now be defined and applied:
      idv :: forall a -> a -> a    -- signature   (relevant change: checkVdqOK in GHC/Tc/Validity.hs)
      idv (type a) (x :: a) = x    -- definition  (relevant change: tcPats in GHC/Tc/Gen/Pat.hs)
      x = idv (type Int) 42        -- usage       (relevant change: tcInstFun in GHC/Tc/Gen/App.hs)

4. template-haskell support:
      TH.TypeE corresponds to HsEmbTy
      TH.TypeP corresponds to EmbTyPat

5. Test cases and a new User's Guide section

Changes *not* included here are the t2t (term-to-type) transformation
and term variable capture; those belong to part 2.

- - - - -
73b5c7ce by sheaf at 2023-07-23T10:28:18-04:00
Add test for #22424

This is a simple Template Haskell test in which we refer to
record selectors by their exact Names, in two different ways.

Fixes #22424

- - - - -
c52bcc84 by Finley McIlwaine at 2023-07-24T09:18:38+01:00
Update haddock and xhtml submodules

Include latest optimizations for haddock, including adaptation to latest xhtml
changes.

Bumps haddock submodule
Bumps xhtml submodule

xhtml is added to the stage0 packages because we need a newer version to
build stage1 haddock. In normal situations we shouldn't be building
stage0 haddock but in case someone attempts to..

- - - - -
518e9a74 by Matthew Pickering at 2023-07-24T09:18:38+01:00
testsuite: Don't need haddock executable when testing stage1 compiler

This causes some unecessary things to be built when testing stage1.
Ideally we want to move to a place where a test properly declares if it
depends on an executable so we only build the ones we actually need
rather than everything.

- - - - -


30 changed files:

- compiler/GHC/Builtin/Names/TH.hs
- compiler/GHC/Core/DataCon.hs
- compiler/GHC/Core/TyCon.hs
- compiler/GHC/Driver/Session.hs
- compiler/GHC/Hs/Expr.hs
- compiler/GHC/Hs/Pat.hs
- compiler/GHC/Hs/Syn/Type.hs
- compiler/GHC/Hs/Utils.hs
- compiler/GHC/HsToCore/Expr.hs
- compiler/GHC/HsToCore/Match.hs
- compiler/GHC/HsToCore/Pmc/Desugar.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Ticks.hs
- compiler/GHC/Iface/Ext/Ast.hs
- compiler/GHC/Parser.y
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Rename/Bind.hs
- compiler/GHC/Rename/Expr.hs
- compiler/GHC/Rename/Pat.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/App.hs
- compiler/GHC/Tc/Gen/Arrow.hs
- compiler/GHC/Tc/Gen/Expr.hs
- compiler/GHC/Tc/Gen/Match.hs
- compiler/GHC/Tc/Gen/Pat.hs
- compiler/GHC/Tc/TyCl/PatSyn.hs
- compiler/GHC/Tc/Types/Evidence.hs
- compiler/GHC/Tc/Types/Origin.hs
- compiler/GHC/Tc/Utils/TcType.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/be9dec8f9cbb240a0458fdf0e323fd077b8c8733...518e9a7469fcaea6883bc31fd2f2471313e25386

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/be9dec8f9cbb240a0458fdf0e323fd077b8c8733...518e9a7469fcaea6883bc31fd2f2471313e25386
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/20230724/92e1ea0d/attachment.html>


More information about the ghc-commits mailing list