<!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>
Sebastian Graf pushed to branch wip/pmcheck-eqs
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/b60b1cac6f6503f3f9df6f250c8cf17e904fe1f5">b60b1cac</a></strong>
<div>
<span>by Sebastian Graf</span>
<i>at 2019-05-20T15:27:31Z</i>
</div>
<pre class="commit-message" style="white-space: pre-wrap; margin: 0;">Make TmOracle reduce nullary constructor equalities

Previously, `simplifyEqExpr` would just give up on constructor
applications when no argument to either constructor was simplified.

That's unfortunate as all arguments might be equal anyway! A special
case of this is nullary constructors. Currently, the TmOracle would fail
to solve a term equality `False ~ (True = True)` because it can't make
any progress on any of `True`s arguments.

Instead we now try to properly simplify the term equality even when no
simplification of constructor arguments was achieved.
</pre>
</li>
</ul>
<h4>1 changed file:</h4>
<ul>
<li class="file-stats">
<a href="#379674a5063221cec43f0f659c2eb67b30339f45">
compiler/deSugar/TmOracle.hs
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id="379674a5063221cec43f0f659c2eb67b30339f45">
<a href="https://gitlab.haskell.org/ghc/ghc/commit/b60b1cac6f6503f3f9df6f250c8cf17e904fe1f5#379674a5063221cec43f0f659c2eb67b30339f45"><strong>compiler/deSugar/TmOracle.hs</strong></a>
<hr>
<table class="code white" style="font-family: monospace; font-size: 90%;" bgcolor="#fff" width="100%" cellpadding="0" cellspacing="0">
<tr class="line_holder match" id="" style="line-height: 1.6;">
<td class="diff-line-num unfold js-unfold old_line" data-linenumber="208" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">...</td>
<td class="diff-line-num unfold js-unfold new_line" data-linenumber="208" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">...</td>
<td class="line_content match " style="padding-left: 0.5em; padding-right: 0.5em; color: rgba(0,0,0,0.3);" bgcolor="#fafafa">@@ -208,10 +208,9 @@ simplifyEqExpr e1 e2 = case (e1, e2) of</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="208" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
208
</td>
<td class="diff-line-num new_line" data-linenumber="208" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
208
</td>
<td class="line_content" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC208" class="line" lang="haskell">            <span class="p">(</span><span class="n" style="color: #333;">ts2'</span><span class="p">,</span> <span class="n" style="color: #333;">bs2</span><span class="p">)</span> <span class="o" style="font-weight: 600;">=</span> <span class="n" style="color: #333;">mapAndUnzip</span> <span class="n" style="color: #333;">simplifyPmExpr</span> <span class="n" style="color: #333;">ts2</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="209" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
209
</td>
<td class="diff-line-num new_line" data-linenumber="209" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
209
</td>
<td class="line_content" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC209" class="line" lang="haskell">            <span class="p">(</span><span class="n" style="color: #333;">tss</span><span class="p">,</span> <span class="n" style="color: #333;">_bss</span><span class="p">)</span> <span class="o" style="font-weight: 600;">=</span> <span class="n" style="color: #333;">zipWithAndUnzip</span> <span class="n" style="color: #333;">simplifyEqExpr</span> <span class="n" style="color: #333;">ts1'</span> <span class="n" style="color: #333;">ts2'</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="210" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
210
</td>
<td class="diff-line-num new_line" data-linenumber="210" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
210
</td>
<td class="line_content" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC210" class="line" lang="haskell">            <span class="n" style="color: #333;">worst_case</span>  <span class="o" style="font-weight: 600;">=</span> <span class="kt" style="color: #458; font-weight: 600;">PmExprEq</span> <span class="p">(</span><span class="kt" style="color: #458; font-weight: 600;">PmExprCon</span> <span class="n" style="color: #333;">c1</span> <span class="n" style="color: #333;">ts1'</span><span class="p">)</span> <span class="p">(</span><span class="kt" style="color: #458; font-weight: 600;">PmExprCon</span> <span class="n" style="color: #333;">c2</span> <span class="n" style="color: #333;">ts2'</span><span class="p">)</span></span>
</pre>
</td>
</tr>
<tr class="line_holder old" id="" style="line-height: 1.6;">
<td class="diff-line-num old old_line" data-linenumber="211" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
211
</td>
<td class="diff-line-num new_line old" data-linenumber="211" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
 
</td>
<td class="line_content old" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#fbe9eb">
<pre style="margin: 0;">-<span id="LC211" class="line" lang="haskell">        <span class="kr" style="font-weight: 600;">in</span>  <span class="kr" style="font-weight: 600;">if</span> <span class="o" style="font-weight: 600;">|</span> <span class="n" style="color: #333;">not</span> <span class="p">(</span><span class="n" style="color: #333;">or</span> <span class="n" style="color: #333;">bs1</span> <span class="o" style="font-weight: 600;">||</span> <span class="n" style="color: #333;">or</span> <span class="n" style="color: #333;">bs2</span><span class="p">)</span> <span class="o" style="font-weight: 600;">-></span> <span class="p">(</span><span class="n" style="color: #333;">worst_case</span><span class="p">,</span> <span class="kt" style="color: #458; font-weight: 600;">False</span><span class="p">)</span> <span class="c1" style="color: #998; font-style: italic;">-- no progress</span></span>
</pre>
</td>
</tr>
<tr class="line_holder old" id="" style="line-height: 1.6;">
<td class="diff-line-num old old_line" data-linenumber="212" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
212
</td>
<td class="diff-line-num new_line old" data-linenumber="211" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
 
</td>
<td class="line_content old" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#fbe9eb">
<pre style="margin: 0;">-<span id="LC212" class="line" lang="haskell">               <span class="o" style="font-weight: 600;">|</span> <span class="n" style="color: #333;">all</span> <span class="n" style="color: #333;">isTruePmExpr</span>  <span class="n" style="color: #333;">tss</span>  <span class="o" style="font-weight: 600;">-></span> <span class="p">(</span><span class="n" style="color: #333;">truePmExpr</span><span class="p">,</span> <span class="kt" style="color: #458; font-weight: 600;">True</span><span class="p">)</span></span>
</pre>
</td>
</tr>
<tr class="line_holder new" id="" style="line-height: 1.6;">
<td class="diff-line-num new old_line" data-linenumber="213" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="diff-line-num new new_line" data-linenumber="211" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
211
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0">
<pre style="margin: 0;">+<span id="LC211" class="line" lang="haskell">        <span class="kr" style="font-weight: 600;">in</span>  <span class="kr" style="font-weight: 600;">if</span> <span class="o" style="font-weight: 600;">|</span> <span class="n" style="color: #333;">all</span> <span class="n" style="color: #333;">isTruePmExpr</span>  <span class="n" style="color: #333;">tss</span>  <span class="o" style="font-weight: 600;">-></span> <span class="p">(</span><span class="n" style="color: #333;">truePmExpr</span><span class="p">,</span> <span class="kt" style="color: #458; font-weight: 600;">True</span><span class="p">)</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="213" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
213
</td>
<td class="diff-line-num new_line" data-linenumber="212" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
212
</td>
<td class="line_content" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC212" class="line" lang="haskell">               <span class="o" style="font-weight: 600;">|</span> <span class="n" style="color: #333;">any</span> <span class="n" style="color: #333;">isFalsePmExpr</span> <span class="n" style="color: #333;">tss</span>  <span class="o" style="font-weight: 600;">-></span> <span class="p">(</span><span class="n" style="color: #333;">falsePmExpr</span><span class="p">,</span> <span class="kt" style="color: #458; font-weight: 600;">True</span><span class="p">)</span></span>
</pre>
</td>
</tr>
<tr class="line_holder old" id="" style="line-height: 1.6;">
<td class="diff-line-num old old_line" data-linenumber="214" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
214
</td>
<td class="diff-line-num new_line old" data-linenumber="213" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #fac5cd; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#f9d7dc">
 
</td>
<td class="line_content old" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#fbe9eb">
<pre style="margin: 0;">-<span id="LC214" class="line" lang="haskell">               <span class="o" style="font-weight: 600;">|</span> <span class="n" style="color: #333;">otherwise</span>              <span class="o" style="font-weight: 600;">-></span> <span class="p">(</span><span class="n" style="color: #333;">worst_case</span><span class="p">,</span> <span class="kt" style="color: #458; font-weight: 600;"><span class="idiff left right">False</span></span><span class="p">)</span></span>
</pre>
</td>
</tr>
<tr class="line_holder new" id="" style="line-height: 1.6;">
<td class="diff-line-num new old_line" data-linenumber="215" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
 
</td>
<td class="diff-line-num new new_line" data-linenumber="213" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #c7f0d2; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#ddfbe6">
213
</td>
<td class="line_content new" style="padding-left: 0.5em; padding-right: 0.5em;" bgcolor="#ecfdf0">
<pre style="margin: 0;">+<span id="LC213" class="line" lang="haskell">               <span class="o" style="font-weight: 600;">|</span> <span class="n" style="color: #333;">otherwise</span>              <span class="o" style="font-weight: 600;">-></span> <span class="p">(</span><span class="n" style="color: #333;">worst_case</span><span class="p">,</span> <span class="n" style="color: #333;"><span class="idiff left">or</span></span><span class="idiff"> </span><span class="n" style="color: #333;"><span class="idiff">bs1</span></span><span class="idiff"> </span><span class="o" style="font-weight: 600;"><span class="idiff">||</span></span><span class="idiff"> </span><span class="n" style="color: #333;"><span class="idiff">or</span></span><span class="idiff"> </span><span class="n" style="color: #333;"><span class="idiff right">bs2</span></span><span class="p">)</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="215" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
215
</td>
<td class="diff-line-num new_line" data-linenumber="214" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
214
</td>
<td class="line_content" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC214" class="line" lang="haskell">    <span class="o" style="font-weight: 600;">|</span> <span class="n" style="color: #333;">otherwise</span> <span class="o" style="font-weight: 600;">-></span> <span class="p">(</span><span class="n" style="color: #333;">falsePmExpr</span><span class="p">,</span> <span class="kt" style="color: #458; font-weight: 600;">True</span><span class="p">)</span></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="216" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
216
</td>
<td class="diff-line-num new_line" data-linenumber="215" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
215
</td>
<td class="line_content" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC215" class="line" lang="haskell"></span>
</pre>
</td>
</tr>
<tr class="line_holder" id="" style="line-height: 1.6;">
<td class="diff-line-num old_line" data-linenumber="217" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
217
</td>
<td class="diff-line-num new_line" data-linenumber="216" style="width: 35px; color: rgba(0,0,0,0.3); border-right-width: 1px; border-right-color: #f0f0f0; border-right-style: solid; padding: 0 5px;" align="right" bgcolor="#fafafa">
216
</td>
<td class="line_content" style="padding-left: 0.5em; padding-right: 0.5em;">
<pre style="margin: 0;"> <span id="LC216" class="line" lang="haskell">  <span class="c1" style="color: #998; font-style: italic;">-- We cannot do anything about the rest..</span></span>
</pre>
</td>
</tr>

</table>
<br>
</li>

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

<br>
<a href="https://gitlab.haskell.org/ghc/ghc/commit/b60b1cac6f6503f3f9df6f250c8cf17e904fe1f5">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.
<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/b60b1cac6f6503f3f9df6f250c8cf17e904fe1f5"}}</script>

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