<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html lang="en" style='--code-editor-font: var(--default-mono-font, "GitLab Mono"), JetBrains Mono, Menlo, DejaVu Sans Mono, Liberation Mono, Consolas, Ubuntu Mono, Courier New, andale mono, lucida console, monospace;'>
<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: .875rem;
}
body {
-webkit-text-shadow: rgba(255,255,255,.01) 0 0 1px;
}
body {
font-family: "GitLab Sans",-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,.01) 0 0 1px; font-family: "GitLab Sans",-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/conpat-one-list at <a href="https://gitlab.haskell.org/ghc/ghc">Glasgow Haskell Compiler / GHC</a>
</h3>
<h4 style="margin-top: 10px; margin-bottom: 10px;">
Commits:
</h4>
<ul>
<li>
<strong style="font-weight: 600;"><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/640080a9e85c12934fea655ec6f0d70c936e30d0">640080a9</a></strong>
<div>
<span> by Vladislav Zavialov </span> <i> at 2025-03-07T02:30:51+03:00 </i>
</div>
<pre class="commit-message" style='white-space: pre-wrap; display: block; font-size: 14px; color: #3a383f; position: relative; font-family: "GitLab Mono", "JetBrains Mono", "Menlo", "DejaVu Sans Mono", "Liberation Mono", "Consolas", "Ubuntu Mono", "Courier New", "andale mono", "lucida console", monospace; font-variant-ligatures: none; word-break: break-all; word-wrap: break-word; background-color: #fbfafd; border-radius: 2px; margin: 0; padding: 8px 12px; border: 1px solid #dcdcde;'>One list in ConPat (part of #25127)
This patch changes PrefixCon to use one list instead of two:
-data HsConDetails tyarg arg rec
- = PrefixCon [tyarg] [arg]
+data HsConDetails arg rec
+ = PrefixCon [arg]
| RecCon rec
| InfixCon arg arg
The [tyarg] list is now gone. To understand the effect of this change,
recall that there are three instantiations of HsConDetails:
1. type HsConPatDetails p =
HsConDetails (HsConPatTyArg (NoGhcTc p)) -- tyarg
(LPat p) -- arg
(HsRecFields p (LPat p)) -- rec
2. type HsConDeclH98Details pass =
HsConDetails Void -- tyarg
(HsScaled pass (LBangType pass)) -- arg
(XRec pass [LConDeclField pass]) -- rec
3. type HsPatSynDetails pass =
HsConDetails Void -- tyarg
(LIdP pass) -- arg
[RecordPatSynField pass] -- rec
In cases (2) and (3), tyarg was instantiated to Void, so the [tyarg]
list was always empty. Its removal is basically a no-op.
The interesting case is (1), which is used in ConPat to represent
pattern matching of the form (MkE @tp1 @tp2 p1 p2).
With this patch, its representation is changed as follows:
ConPat "MkE" [tp1, tp2] [p1, p2] -- old
ConPat "MkE" [InvisP tp1, InvisP tp2, p1, p2] -- new
The new mixed-list representation is consintent with lambdas, where
InvisP is already used to deal with \ @tp1 tp2 p1 p2 -> body.
The immediate effect of the new representation is an improvement to
error messages. Consider the pattern (Con x @t y). Previously it
resulted in a parse error because @t could not occur after x. Now it is
reported as [GHC-14964]. Test case: TyAppPat_MisplacedApplication.
In the long term, this is intended as preparation for #18389 and #25127,
which would make (Con x @t y) potentially valid, e.g. if its type is
Con :: forall a -> forall b. (a, b) -> T
The TH AST is left unchanged for the moment to avoid breakage.
</pre>
</li>
</ul>
<h4 style="margin-top: 10px; margin-bottom: 10px;">
54 changed files:
</h4>
<ul>
<li class="file-stats">
<a href="#65ca06d51797ebf672a62bde6c00bcb9444e1425">
compiler/GHC/Hs/Binds.hs
</a>
</li>
<li class="file-stats">
<a href="#75bfcd03f3ba9315d33104fcb0424c6bfeb4e334">
compiler/GHC/Hs/Decls.hs
</a>
</li>
<li class="file-stats">
<a href="#9f00edfedb0f969865b049a78de3866545b4a60b">
compiler/GHC/Hs/Instances.hs
</a>
</li>
<li class="file-stats">
<a href="#0bae7e7e67b5f9b6ba2a371f8917cf74423a0c6f">
compiler/GHC/Hs/Pat.hs
</a>
</li>
<li class="file-stats">
<a href="#018be522bc4813b147a1525e4f96a7a493207d96">
compiler/GHC/Hs/Type.hs
</a>
</li>
<li class="file-stats">
<a href="#7a1af22e4c32b9aa6ec708d9d3788e1c4db5da9a">
compiler/GHC/Hs/Utils.hs
</a>
</li>
<li class="file-stats">
<a href="#ea46b374e004d4416e29a563ee063542f98e48c5">
compiler/GHC/HsToCore/Docs.hs
</a>
</li>
<li class="file-stats">
<a href="#085703923f9c18f6ac9f926ac9a4c7c7e6d9d9ed">
compiler/GHC/HsToCore/Match.hs
</a>
</li>
<li class="file-stats">
<a href="#b370399ae1ab68e37f0e631d98a45da6df9f011c">
compiler/GHC/HsToCore/Match/Constructor.hs
</a>
</li>
<li class="file-stats">
<a href="#950eaa7de202a2e915b5ff68a4cfd16e972ad359">
compiler/GHC/HsToCore/Pmc/Desugar.hs
</a>
</li>
<li class="file-stats">
<a href="#3c19c0be465f9a28d7b69f89c55648080fcc37eb">
compiler/GHC/HsToCore/Quote.hs
</a>
</li>
<li class="file-stats">
<a href="#649144a78135a23cabfc90dd83c4aabf448eb6ab">
compiler/GHC/Iface/Ext/Ast.hs
</a>
</li>
<li class="file-stats">
<a href="#bf951467d4a9aa443cb109cb4c84a2891945649b">
compiler/GHC/Parser.y
</a>
</li>
<li class="file-stats">
<a href="#4769efc0cb06e92bc7562e31984f6d7d91048e51">
compiler/GHC/Parser/Errors/Ppr.hs
</a>
</li>
<li class="file-stats">
<a href="#6bd0eb7fd0a01f3d8cf2efe3f1d026d2145cf10b">
compiler/GHC/Parser/Errors/Types.hs
</a>
</li>
<li class="file-stats">
<a href="#446cb12ca6cefaf1c6eb79b7db643632744263c7">
compiler/GHC/Parser/PostProcess.hs
</a>
</li>
<li class="file-stats">
<a href="#13755bdc5d6c6b4c6f31604eb0da778521355795">
compiler/GHC/Parser/PostProcess/Haddock.hs
</a>
</li>
<li class="file-stats">
<a href="#af762064d779f7308dd415966c974f27d14f9943">
compiler/GHC/Rename/Bind.hs
</a>
</li>
<li class="file-stats">
<a href="#7dd1cd0f6f2164a14c83d9aa564dd32bc30e447a">
compiler/GHC/Rename/Module.hs
</a>
</li>
<li class="file-stats">
<a href="#cfa41b5649933e5b12f7796e9d49b9dd6a0bc59f">
compiler/GHC/Rename/Pat.hs
</a>
</li>
<li class="file-stats">
<a href="#939d24c1002dc322659c1f67c9f3d2db2ae31dd4">
compiler/GHC/Rename/Utils.hs
</a>
</li>
<li class="file-stats">
<a href="#6a1f039ed7725eddef15dd5f4dc318a3434f26c9">
compiler/GHC/Tc/Gen/App.hs
</a>
</li>
<li class="file-stats">
<a href="#3ee8be814b6c6727880deab3772e6af922524bf0">
compiler/GHC/Tc/Gen/Pat.hs
</a>
</li>
<li class="file-stats">
<a href="#83d23a46bb6cdc8b1edc16f1fd2c8f5c53e2c9ca">
compiler/GHC/Tc/TyCl.hs
</a>
</li>
<li class="file-stats">
<a href="#5c0a7f8291c984f0fc06f59e7cf10dbecc11598b">
compiler/GHC/Tc/TyCl/PatSyn.hs
</a>
</li>
<li class="file-stats">
<a href="#70276ecbf78c4d6abaaaba692722a2a4e2e46167">
compiler/GHC/Tc/Zonk/Type.hs
</a>
</li>
<li class="file-stats">
<a href="#2eac51f9871ca0c0698aa1fc7f79c05ef8fc4a49">
compiler/GHC/ThToHs.hs
</a>
</li>
<li class="file-stats">
<a href="#be1ee9a9349dfcfcaa49c4ef7eb91a31b326c982">
compiler/GHC/Types/GREInfo.hs
</a>
</li>
<li class="file-stats">
<a href="#00df6c149812cb8e21335d2ec26d0f24bdf1e441">
compiler/Language/Haskell/Syntax/Binds.hs
</a>
</li>
<li class="file-stats">
<a href="#997b81d43f8807b1b83ca6cc7c52b367982f2bf7">
compiler/Language/Haskell/Syntax/Decls.hs
</a>
</li>
<li class="file-stats">
<a href="#f92237bbf761245188d3b0de16bb685b3eaa2b60">
compiler/Language/Haskell/Syntax/Pat.hs
</a>
</li>
<li class="file-stats">
<a href="#ef5ad6f4dfc8fa107eace213eecba4bc1014ca57">
compiler/Language/Haskell/Syntax/Type.hs
</a>
</li>
<li class="file-stats">
<a href="#c667b660d548272e27f44bf34c9a844c019bd6f7">
testsuite/tests/ghc-api/exactprint/Test20239.stderr
</a>
</li>
<li class="file-stats">
<a href="#4caabe37afee285fec3f18b82331ba583cdb8460">
testsuite/tests/haddock/should_compile_flag_haddock/T24221.stderr
</a>
</li>
<li class="file-stats">
<a href="#e6a699bed61e0c8d8109f383d714115200dd37b4">
testsuite/tests/parser/should_compile/DumpParsedAst.stderr
</a>
</li>
<li class="file-stats">
<a href="#338eb1c1a80bcdbcecf4018a1808183f4305c65b">
testsuite/tests/parser/should_compile/DumpRenamedAst.stderr
</a>
</li>
<li class="file-stats">
<a href="#c7cbb518abd02952b7e40de417eb0ee3adf61a8c">
testsuite/tests/parser/should_compile/T14189.stderr
</a>
</li>
<li class="file-stats">
<a href="#7bf6b8534c3526853866ce7ffe6017cfe65b7bf8">
testsuite/tests/parser/should_compile/T20452.stderr
</a>
</li>
<li class="file-stats">
<a href="#8cb35be8f13ce47421a8f834d7262e0459fb7e5a">
testsuite/tests/printer/Test24533.stdout
</a>
</li>
<li class="file-stats">
<a href="#e2df39d81b450380a21f85a11d8553ca0aadc3ed">
testsuite/tests/rename/should_fail/T22478b.stderr
</a>
</li>
<li class="file-stats">
<a href="#34ec0e2feed75b3250a8bac12e8b4d878017cf72">
testsuite/tests/rename/should_fail/T22478e.stderr
</a>
</li>
<li class="file-stats">
<a href="#6421eead48ad9b780f446fece308f9084188a949">
testsuite/tests/rename/should_fail/T22478f.stderr
</a>
</li>
<li class="file-stats">
<a href="#e579a029b2f46ab9f292d1c4f6d5dc2ecc10df08">
testsuite/tests/typecheck/should_fail/T19109.stderr
</a>
</li>
<li class="file-stats">
<a href="#6c9724fbbee5971641b6197a36e360bbe73db0ff">
testsuite/tests/typecheck/should_fail/T23776.stderr
</a>
</li>
<li class="file-stats">
<a href="#1fc2042c2492debe6a90ce957ec7ee22e9868879">
testsuite/tests/typecheck/should_fail/TyAppPat_MisplacedApplication.hs
</a>
</li>
<li class="file-stats">
<a href="#6da24144a737c05652b2132eb31661fd166e9b9c">
testsuite/tests/typecheck/should_fail/TyAppPat_MisplacedApplication.stderr
</a>
</li>
<li class="file-stats">
<a href="#c5662bedafa6a48ec7062b131d94b70f514207d9">
utils/check-exact/ExactPrint.hs
</a>
</li>
<li class="file-stats">
<a href="#e034a4a4a1857305273379f05bf424df17c5638c">
utils/haddock/haddock-api/src/Haddock/Backends/Hoogle.hs
</a>
</li>
<li class="file-stats">
<a href="#8f82ba6dff88f9e7ad4870c8bdc938435fbc41ba">
utils/haddock/haddock-api/src/Haddock/Backends/LaTeX.hs
</a>
</li>
<li class="file-stats">
<a href="#0021f6c1d2d8be0699c998ebc0f356fdcb274b87">
utils/haddock/haddock-api/src/Haddock/Backends/Xhtml/Decl.hs
</a>
</li>
<li class="file-stats">
<a href="#cb92c0da89f4484c35cb51446517efc852c873f6">
utils/haddock/haddock-api/src/Haddock/Convert.hs
</a>
</li>
<li class="file-stats">
<a href="#47431656008a8a76a307d7241eb1e403599e0d87">
utils/haddock/haddock-api/src/Haddock/GhcUtils.hs
</a>
</li>
<li class="file-stats">
<a href="#dffd8f88371490d2739689b42e6243e5df222760">
utils/haddock/haddock-api/src/Haddock/Interface/Create.hs
</a>
</li>
<li class="file-stats">
<a href="#40c8e31ea57a3820afaa253b1bc8c6c268605ec6">
utils/haddock/haddock-api/src/Haddock/Interface/Rename.hs
</a>
</li>
</ul>
<h5 style="margin-top: 10px; margin-bottom: 10px; font-size: .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: #626168;">
—
<br>
<a href="https://gitlab.haskell.org/ghc/ghc/-/commit/640080a9e85c12934fea655ec6f0d70c936e30d0">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">gitlab.haskell.org</a>. <a href="https://gitlab.haskell.org/-/profile/notifications" target="_blank" rel="noopener noreferrer" class="mng-notif-link">Manage all notifications</a> · <a href="https://gitlab.haskell.org/help" target="_blank" rel="noopener noreferrer" class="help-link">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/640080a9e85c12934fea655ec6f0d70c936e30d0"}}</script>
</p>
</div>
</body>
</html>