[Git][ghc/ghc][wip/t23487] 4 commits: Invisible binders in type declarations (#22560)

Finley McIlwaine (@FinleyMcIlwaine) gitlab at gitlab.haskell.org
Wed Jun 7 17:30:09 UTC 2023



Finley McIlwaine pushed to branch wip/t23487 at Glasgow Haskell Compiler / GHC


Commits:
4aea0a72 by Vladislav Zavialov at 2023-06-07T12:06:46+02:00
Invisible binders in type declarations (#22560)

This patch implements @k-binders introduced in GHC Proposal #425
and guarded behind the TypeAbstractions extension:

	type D :: forall k j. k -> j -> Type
	data D @k @j a b = ...
	       ^^ ^^

To represent the new syntax, we modify LHsQTyVars as follows:

	-  hsq_explicit :: [LHsTyVarBndr () pass]
	+  hsq_explicit :: [LHsTyVarBndr (HsBndrVis pass) pass]

HsBndrVis is a new data type that records the distinction between
type variable binders written with and without the @ sign:

	data HsBndrVis pass
	  = HsBndrRequired
	  | HsBndrInvisible (LHsToken "@" pass)

The rest of the patch updates GHC, template-haskell, and haddock
to handle the new syntax.

Parser:
  The PsErrUnexpectedTypeAppInDecl error message is removed.
  The syntax it used to reject is now permitted.

Renamer:
  The @ sign does not affect the scope of a binder, so the changes to
  the renamer are minimal.  See rnLHsTyVarBndrVisFlag.

Type checker:
  There are three code paths that were updated to deal with the newly
  introduced invisible type variable binders:

    1. checking SAKS: see kcCheckDeclHeader_sig, matchUpSigWithDecl
    2. checking CUSK: see kcCheckDeclHeader_cusk
    3. inference: see kcInferDeclHeader, rejectInvisibleBinders

  Helper functions bindExplicitTKBndrs_Q_Skol and bindExplicitTKBndrs_Q_Tv
  are generalized to work with HsBndrVis.

Updates the haddock submodule.

Metric Increase:
    MultiLayerModulesTH_OneShot

Co-authored-by: Simon Peyton Jones <simon.peytonjones at gmail.com>

- - - - -
b7600997 by Josh Meredith at 2023-06-07T13:10:21-04:00
JS: clean up FFI 'fat arrow' calls in base:System.Posix.Internals (#23481)

- - - - -
6292778e by Finley McIlwaine at 2023-06-07T17:30:07+00:00
Fix incompatible pointer type warnings

- - - - -
09e1e490 by Finley McIlwaine at 2023-06-07T17:30:07+00:00
Remove IPE compression config from deb10 nightly

Fixes #23487

- - - - -


30 changed files:

- .gitlab/gen_ci.hs
- .gitlab/jobs.yaml
- compiler/GHC/Builtin/Names/TH.hs
- compiler/GHC/Core/TyCon.hs
- compiler/GHC/Hs/Instances.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/Parser/Errors/Ppr.hs
- compiler/GHC/Parser/Errors/Types.hs
- compiler/GHC/Parser/PostProcess.hs
- compiler/GHC/Rename/HsType.hs
- compiler/GHC/Tc/Errors/Ppr.hs
- compiler/GHC/Tc/Errors/Types.hs
- compiler/GHC/Tc/Gen/HsType.hs
- compiler/GHC/Tc/Gen/Splice.hs
- compiler/GHC/Tc/TyCl.hs
- compiler/GHC/Tc/Utils/TcType.hs
- compiler/GHC/Tc/Zonk/TcType.hs
- compiler/GHC/ThToHs.hs
- compiler/GHC/Types/Error/Codes.hs
- compiler/GHC/Types/Hint.hs
- compiler/GHC/Types/Hint/Ppr.hs
- compiler/Language/Haskell/Syntax/Type.hs
- docs/users_guide/9.8.1-notes.rst
- docs/users_guide/exts/primitives.rst
- docs/users_guide/exts/type_abstractions.rst
- libraries/base/System/Posix/Internals.hs
- libraries/ghci/GHCi/TH/Binary.hs
- libraries/template-haskell/Language/Haskell/TH.hs
- libraries/template-haskell/Language/Haskell/TH/Lib.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/97dd850ed7ed03d708e60bdbd1340405db015e67...09e1e490e2b1e75fbdd8ae56a9220a6707fef0f3

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/97dd850ed7ed03d708e60bdbd1340405db015e67...09e1e490e2b1e75fbdd8ae56a9220a6707fef0f3
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/20230607/7468cb57/attachment.html>


More information about the ghc-commits mailing list