<!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>img {
max-width: 100%; height: auto;
}
</style>
</head>
<body>
<div class="content">

<h3>
Ben Gamari pushed to branch master
at <a href="https://gitlab.haskell.org/ghc/ghc">Glasgow Haskell Compiler / GHC</a>
</h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/686e06c59c3aa6b66895e8a501c7afb019b09e36">686e06c5</a></strong>
<div>
<span>by Vladislav Zavialov</span>
<i>at 2020-08-06T13:34:05-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Grammar for types and data/newtype constructors

Before this patch, we parsed types into a reversed sequence
of operators and operands. For example, (F x y + G a b * X)
would be parsed as [X, *, b, a, G, +, y, x, F],
using a simple grammar:

        tyapps
          : tyapp
          | tyapps tyapp

        tyapp
          : atype
          | PREFIX_AT atype
          | tyop
          | unpackedness

Then we used a hand-written state machine to assemble this
 either into a type,        using 'mergeOps',
     or into a constructor, using 'mergeDataCon'.

This is due to a syntactic ambiguity:

        data T1 a =          MkT1 a
        data T2 a = Ord a => MkT2 a

In T1, what follows after the = sign is a data/newtype constructor
declaration. However, in T2, what follows is a type (of kind
Constraint). We don't know which of the two we are parsing until we
encounter =>, and we cannot check for => without unlimited lookahead.

This poses a few issues when it comes to e.g. infix operators:

        data I1 = Int :+ Bool :+ Char          -- bad
        data I2 = Int :+ Bool :+ Char => MkI2  -- fine

By this issue alone we are forced into parsing into an intermediate
representation and doing a separate validation pass.

However, should that intermediate representation be as low-level as a
flat sequence of operators and operands?

Before GHC Proposal #229, the answer was Yes, due to some particularly
nasty corner cases:

        data T = ! A :+ ! B          -- used to be fine, hard to parse
        data T = ! A :+ ! B => MkT   -- bad

However, now the answer is No, as this corner case is gone:

        data T = ! A :+ ! B          -- bad
        data T = ! A :+ ! B => MkT   -- bad

This means we can write a proper grammar for types, overloading it in
the DisambECP style, see Note [Ambiguous syntactic categories].

With this patch, we introduce a new class, DisambTD. Just like
DisambECP is used to disambiguate between expressions, commands, and patterns,
DisambTD  is used to disambiguate between types and data/newtype constructors.

This way, we get a proper, declarative grammar for constructors and
types:

        infixtype
          : ftype
          | ftype tyop infixtype
          | unpackedness infixtype

        ftype
          : atype
          | tyop
          | ftype tyarg
          | ftype PREFIX_AT tyarg

        tyarg
          : atype
          | unpackedness atype

And having a grammar for types means we are a step closer to using a
single grammar for types and expressions.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/6770e199645b0753d2edfddc68c199861a1be980">6770e199</a></strong>
<div>
<span>by Vladislav Zavialov</span>
<i>at 2020-08-06T13:34:05-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Clean up the story around runPV/runECP_P/runECP_PV

This patch started as a small documentation change, an attempt to make
Note [Parser-Validator] and Note [Ambiguous syntactic categories]
more clear and up-to-date.

But it turned out that runECP_P/runECP_PV are weakly motivated,
and it's easier to remove them than to find a good rationale/explanation
for their existence.

As the result, there's a bit of refactoring in addition to
a documentation update.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/826d07db0e0f31fe2b2d2e0661be7f0cb3cde3c7">826d07db</a></strong>
<div>
<span>by Vladislav Zavialov</span>
<i>at 2020-08-06T13:34:06-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Fix debug_ppr_ty ForAllTy (#18522)

Before this change, GHC would
pretty-print   forall k. forall a -> ()
          as   forall @k a. ()
which isn't even valid Haskell.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/0ddb43848b9fc24f5404915f57dc504546e68292">0ddb4384</a></strong>
<div>
<span>by Vladislav Zavialov</span>
<i>at 2020-08-06T13:34:06-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Fix visible forall in ppr_ty (#18522)

Before this patch, this type:
  T :: forall k -> (k ~ k) => forall j -> k -> j -> Type
was printed incorrectly as:
  T :: forall k j -> (k ~ k) => k -> j -> Type
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/d2a432258fa00e22ca386ef30d0a77ff5b277db8">d2a43225</a></strong>
<div>
<span>by Richard Eisenberg</span>
<i>at 2020-08-06T13:34:06-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Fail eagerly on a lev-poly datacon arg

Close #18534.

See commentary in the patch.
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/63348155404c64334fa864454132630f9d2a4d7f">63348155</a></strong>
<div>
<span>by Sylvain Henry</span>
<i>at 2020-08-06T13:34:08-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Use a type alias for Ways
</pre>
</li>
<li>
<strong><a href="https://gitlab.haskell.org/ghc/ghc/-/commit/9570c21295a2b4a1d1e40939869124f0b9b9bf91">9570c212</a></strong>
<div>
<span>by Takenobu Tani</span>
<i>at 2020-08-06T19:46:46-04:00</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">users-guide: Rename 8.12 to 9.0

GHC 8.12.1 has been renamed to GHC 9.0.1.

See also:
  https://mail.haskell.org/pipermail/ghc-devs/2020-July/019083.html

[skip ci]
</pre>
</li>
</ul>
<h4>30 changed files:</h4>
<ul>
<li class="file-stats">
<a href="#379343fa560df0c7451aa5a1dd4f074dd37924d0">
compiler/GHC/Core/TyCo/Ppr.hs
</a>
</li>
<li class="file-stats">
<a href="#774d88050336ef660c7a219fb06c480c2fc639bc">
compiler/GHC/Driver/Session.hs
</a>
</li>
<li class="file-stats">
<a href="#f2b2b84d138b362920ab9f144f58bf16254aab64">
compiler/GHC/Iface/Type.hs
</a>
</li>
<li class="file-stats">
<a href="#bf951467d4a9aa443cb109cb4c84a2891945649b">
compiler/GHC/Parser.y
</a>
</li>
<li class="file-stats">
<a href="#446cb12ca6cefaf1c6eb79b7db643632744263c7">
compiler/GHC/Parser/PostProcess.hs
</a>
</li>
<li class="file-stats">
<a href="#c27cdc950c486cfe9eb3b7c0373e9dfbe084c6c4">
compiler/GHC/Platform/Profile.hs
</a>
</li>
<li class="file-stats">
<a href="#86ace7226fc7af9ab86c9de74cea778459a0f84f">
compiler/GHC/Platform/Ways.hs
</a>
</li>
<li class="file-stats">
<a href="#83d23a46bb6cdc8b1edc16f1fd2c8f5c53e2c9ca">
compiler/GHC/Tc/TyCl.hs
</a>
</li>
<li class="file-stats">
<a href="#fb39dbd5a18747427e8ae2c57dcdde3473e65a53">
compiler/GHC/Unit/State.hs
</a>
</li>
<li class="file-stats">
<a href="#85c07986c623f3180b40021d7109edd1e6a71a93">
docs/users_guide/8.12.1-notes.rst

docs/users_guide/9.0.1-notes.rst
</a>
</li>
<li class="file-stats">
<a href="#67a7e440f848e5233e24f587c2e02fde258d232a">
docs/users_guide/exts/lambda_case.rst
</a>
</li>
<li class="file-stats">
<a href="#f86c1b4986fc1a29572fa45c0cb2eb181d605273">
docs/users_guide/exts/lexical_negation.rst
</a>
</li>
<li class="file-stats">
<a href="#228f7530ac2289de7848ad95774f7aa4673c4431">
docs/users_guide/exts/linear_types.rst
</a>
</li>
<li class="file-stats">
<a href="#afc5c9567f619749d27f89c5904b2eb41814069c">
docs/users_guide/exts/negative_literals.rst
</a>
</li>
<li class="file-stats">
<a href="#1c247d41be445a4c69a7b78b184d59d807c6183e">
docs/users_guide/exts/qualified_do.rst
</a>
</li>
<li class="file-stats">
<a href="#96a304b83d0bf4600831c1a4fbfe7fd74edeee69">
docs/users_guide/release-notes.rst
</a>
</li>
<li class="file-stats">
<a href="#e16ae6db99f98868d3603a0c7df0bb6a793a330d">
docs/users_guide/using-warnings.rst
</a>
</li>
<li class="file-stats">
<a href="#5ff2ade90c007a336603fdf2c260560031a87873">
<span class="new-file">
+
testsuite/tests/ghc-api/T18522-dbg-ppr.hs
</span>
</a>
</li>
<li class="file-stats">
<a href="#5e90a4e8297b1a47c64f800e68da2299afc25c2f">
<span class="new-file">
+
testsuite/tests/ghc-api/T18522-dbg-ppr.stdout
</span>
</a>
</li>
<li class="file-stats">
<a href="#6d92d90388a97d8ff12e9d812f64e3a5f296df09">
testsuite/tests/ghc-api/all.T
</a>
</li>
<li class="file-stats">
<a href="#4af8c80ad95e2d73aa08d7a4d01067cfdb631a0d">
testsuite/tests/parser/should_fail/T12045d.stderr
</a>
</li>
<li class="file-stats">
<a href="#4679984903c9dfd01802a8e2f11ce0695f8edab1">
testsuite/tests/parser/should_fail/strictnessDataCon_B.stderr
</a>
</li>
<li class="file-stats">
<a href="#71ec3fb03dc169cde30f3924537f1f659bfecca2">
testsuite/tests/parser/should_fail/typeops_A.stderr
</a>
</li>
<li class="file-stats">
<a href="#cd440403ec6f92fd367ccdb5dee68f75372acdea">
testsuite/tests/parser/should_fail/typeops_C.stderr
</a>
</li>
<li class="file-stats">
<a href="#83efd84736b1b04558d46a721425063d6089ebdc">
testsuite/tests/parser/should_fail/unpack_empty_type.stderr
</a>
</li>
<li class="file-stats">
<a href="#97d3ddf3956e1f1d81c23112a401865f6f7974f8">
testsuite/tests/parser/should_fail/unpack_inside_type.stderr
</a>
</li>
<li class="file-stats">
<a href="#62acbc236d9cbfd951174fd4f8b073a92feda575">
<span class="new-file">
+
testsuite/tests/polykinds/T18522-ppr.script
</span>
</a>
</li>
<li class="file-stats">
<a href="#318e67aab32010ac2f696a15e8fbc12b2383b52b">
<span class="new-file">
+
testsuite/tests/polykinds/T18522-ppr.stdout
</span>
</a>
</li>
<li class="file-stats">
<a href="#37bb83d0a916288b2296ba25cdbbef228eed6484">
testsuite/tests/polykinds/all.T
</a>
</li>
<li class="file-stats">
<a href="#896dfa0c13813de8c560c2b9d6d98b367ed0b12b">
<span class="new-file">
+
testsuite/tests/typecheck/should_fail/T18534.hs
</span>
</a>
</li>
</ul>
<h5>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: #777;">

<br>
<a href="https://gitlab.haskell.org/ghc/ghc/-/compare/fbcb886d503dd7aaebc4c40e59615068b3fd0bd7...9570c21295a2b4a1d1e40939869124f0b9b9bf91">View it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.haskell.org.
If you'd like to receive fewer emails, you can
adjust your notification settings.



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