<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en">
<head>
<meta content="text/html; charset=US-ASCII" http-equiv="Content-Type">
<title>
GitLab
</title>

<style data-premailer="ignore" type="text/css">
a { color: #1068bf; }
</style>


<style>img {
max-width: 100%; height: auto;
}
body {
font-size: 0.875rem;
}
body {
-webkit-text-shadow: rgba(255,255,255,0.01) 0 0 1px;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-size: inherit;
}
</style>
</head>
<body style='font-size: inherit; -webkit-text-shadow: rgba(255,255,255,0.01) 0 0 1px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";'>
<div class="content">

<h3 style="margin-top: 20px; margin-bottom: 10px;">
Vladislav Zavialov pushed to branch wip/int-index/decl-invis-binders at <a href="https://gitlab.haskell.org/ghc/ghc" style="color: #1068bf;">Glasgow Haskell Compiler / GHC</a>
</h3>
<h4 style="margin-top: 10px; margin-bottom: 10px;">
Commits:
</h4>
<ul>
<li>
<strong style="font-weight: bold;"><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/543b89a50995d93fac59678cad0d28215c5a3920" style="color: #1068bf;">543b89a5</a></strong>
<div>
<span> by Vladislav Zavialov </span> <i> at 2023-01-30T17:36:39+03:00 </i>
</div>
<pre class="commit-message" style='white-space: pre-wrap; display: block; font-size: 0.8125rem; color: #303030; position: relative; font-family: "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; word-break: break-all; word-wrap: break-word; background-color: #fafafa; border-radius: 2px; margin: 0; padding: 8px 12px; border: 1px solid #dbdbdb;'>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

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

Updates the haddock submodule.

Co-authored-by: Simon Peyton Jones <simon.peytonjones@gmail.com>
</pre>
</li>
</ul>
<h4 style="margin-top: 10px; margin-bottom: 10px;">
30 changed files:
</h4>
<ul>
<li class="file-stats">
<a href="#06764eb0158306b83ab1998d18316392a51838c2" style="color: #1068bf;">
compiler/GHC/Builtin/Names/TH.hs
</a>
</li>
<li class="file-stats">
<a href="#4aad0050db1a8a20db8bbca149111de99cb299c9" style="color: #1068bf;">
compiler/GHC/Core/TyCon.hs
</a>
</li>
<li class="file-stats">
<a href="#9f00edfedb0f969865b049a78de3866545b4a60b" style="color: #1068bf;">
compiler/GHC/Hs/Instances.hs
</a>
</li>
<li class="file-stats">
<a href="#018be522bc4813b147a1525e4f96a7a493207d96" style="color: #1068bf;">
compiler/GHC/Hs/Type.hs
</a>
</li>
<li class="file-stats">
<a href="#3c19c0be465f9a28d7b69f89c55648080fcc37eb" style="color: #1068bf;">
compiler/GHC/HsToCore/Quote.hs
</a>
</li>
<li class="file-stats">
<a href="#4769efc0cb06e92bc7562e31984f6d7d91048e51" style="color: #1068bf;">
compiler/GHC/Parser/Errors/Ppr.hs
</a>
</li>
<li class="file-stats">
<a href="#6bd0eb7fd0a01f3d8cf2efe3f1d026d2145cf10b" style="color: #1068bf;">
compiler/GHC/Parser/Errors/Types.hs
</a>
</li>
<li class="file-stats">
<a href="#446cb12ca6cefaf1c6eb79b7db643632744263c7" style="color: #1068bf;">
compiler/GHC/Parser/PostProcess.hs
</a>
</li>
<li class="file-stats">
<a href="#892acbb198a9095c917740d3c1297b56df4e3b7e" style="color: #1068bf;">
compiler/GHC/Rename/HsType.hs
</a>
</li>
<li class="file-stats">
<a href="#1dd9c7a6bbc222c976a6ec1c4b772232ae60f7e5" style="color: #1068bf;">
compiler/GHC/Tc/Errors/Ppr.hs
</a>
</li>
<li class="file-stats">
<a href="#cdba811872892f235fe7059df1a6c538fba60816" style="color: #1068bf;">
compiler/GHC/Tc/Errors/Types.hs
</a>
</li>
<li class="file-stats">
<a href="#9355bef855426caf5f526925edf351b20f9a86c4" style="color: #1068bf;">
compiler/GHC/Tc/Gen/HsType.hs
</a>
</li>
<li class="file-stats">
<a href="#9ea832ccdb4b5f7508a1efd6caedeafa16b269e7" style="color: #1068bf;">
compiler/GHC/Tc/Gen/Splice.hs
</a>
</li>
<li class="file-stats">
<a href="#83d23a46bb6cdc8b1edc16f1fd2c8f5c53e2c9ca" style="color: #1068bf;">
compiler/GHC/Tc/TyCl.hs
</a>
</li>
<li class="file-stats">
<a href="#94c96afe1bb3b771ffbcfeeca34ce43ebbe76ccb" style="color: #1068bf;">
compiler/GHC/Tc/Utils/TcMType.hs
</a>
</li>
<li class="file-stats">
<a href="#5461e7beeb7ae73d7c01f720cbaa3fa2c5333590" style="color: #1068bf;">
compiler/GHC/Tc/Utils/TcType.hs
</a>
</li>
<li class="file-stats">
<a href="#2eac51f9871ca0c0698aa1fc7f79c05ef8fc4a49" style="color: #1068bf;">
compiler/GHC/ThToHs.hs
</a>
</li>
<li class="file-stats">
<a href="#e2c828ee9e003df518a07b05beaa6971e5c62eb0" style="color: #1068bf;">
compiler/GHC/Types/Error/Codes.hs
</a>
</li>
<li class="file-stats">
<a href="#0d674271b5e602f8c38b813c8c42593afce96a1b" style="color: #1068bf;">
compiler/GHC/Types/Hint.hs
</a>
</li>
<li class="file-stats">
<a href="#5543c5c6c25dc2d751debfc3bc1be17365251351" style="color: #1068bf;">
compiler/GHC/Types/Hint/Ppr.hs
</a>
</li>
<li class="file-stats">
<a href="#ef5ad6f4dfc8fa107eace213eecba4bc1014ca57" style="color: #1068bf;">
compiler/Language/Haskell/Syntax/Type.hs
</a>
</li>
<li class="file-stats">
<a href="#56cab10ba9d31c526f47a492a4151a878077dc2d" style="color: #1068bf;">
docs/users_guide/9.8.1-notes.rst
</a>
</li>
<li class="file-stats">
<a href="#371a6fbdfe576b6a90fb252b0ef1a97c7488f006" style="color: #1068bf;">
docs/users_guide/exts/primitives.rst
</a>
</li>
<li class="file-stats">
<a href="#e1fda7a47737ee512bcbf1b5941aa3474719cae5" style="color: #1068bf;">
docs/users_guide/exts/type_abstractions.rst
</a>
</li>
<li class="file-stats">
<a href="#f2be3722dbfecb9150fcd7084cce2a871fb32d94" style="color: #1068bf;">
libraries/ghci/GHCi/TH/Binary.hs
</a>
</li>
<li class="file-stats">
<a href="#b1ae9d61e7dc1aafaeeab37b56c3a045e926a855" style="color: #1068bf;">
libraries/template-haskell/Language/Haskell/TH.hs
</a>
</li>
<li class="file-stats">
<a href="#556b3bb7c75dfe37155d079195cb9671e3061783" style="color: #1068bf;">
libraries/template-haskell/Language/Haskell/TH/Lib.hs
</a>
</li>
<li class="file-stats">
<a href="#97b63f699307e7a6d92425265508cfc9e963c336" style="color: #1068bf;">
libraries/template-haskell/Language/Haskell/TH/Lib/Internal.hs
</a>
</li>
<li class="file-stats">
<a href="#8e584d18427a4bfabb2a7d6fce6efcbc2afb0954" style="color: #1068bf;">
libraries/template-haskell/Language/Haskell/TH/Ppr.hs
</a>
</li>
<li class="file-stats">
<a href="#ed3c6537b674490396f9cab5cbb014ee54e71168" style="color: #1068bf;">
libraries/template-haskell/Language/Haskell/TH/Syntax.hs
</a>
</li>
</ul>
<h5 style="margin-top: 10px; margin-bottom: 10px; font-size: 0.875rem;">
The diff was not included because it is too large.
</h5>

</div>
<div class="footer" style="margin-top: 10px;">
<p style="font-size: small; color: #666;">

<br>
<a href="https://gitlab.haskell.org/ghc/ghc/-/commit/543b89a50995d93fac59678cad0d28215c5a3920" style="color: #1068bf;">View it on GitLab</a>.
<br>
You're receiving this email because of your account on <a target="_blank" rel="noopener noreferrer" href="https://gitlab.haskell.org" style="color: #1068bf;">gitlab.haskell.org</a>. <a href="https://gitlab.haskell.org/-/profile/notifications" target="_blank" rel="noopener noreferrer" class="mng-notif-link" style="color: #1068bf;">Manage all notifications</a> · <a href="https://gitlab.haskell.org/help" target="_blank" rel="noopener noreferrer" class="help-link" style="color: #1068bf;">Help</a>
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Commit","url":"https://gitlab.haskell.org/ghc/ghc/-/commit/543b89a50995d93fac59678cad0d28215c5a3920"}}</script>


</p>
</div>
</body>
</html>