<div dir="ltr"><div class="markdown-here-wrapper" style=""><p style="margin:0px 0px 1.2em!important">On Fri, Sep 4, 2020 at 5:47 PM Iavor Diatchki <<a href="mailto:iavor.diatchki@gmail.com" target="_blank">iavor.diatchki@gmail.com</a>> wrote:</p>
<p style="margin:0px 0px 1.2em!important"></p><div class="markdown-here-exclude"><p></p><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Yes</div></blockquote><p></p></div><p style="margin:0px 0px 1.2em!important"></p>
<p style="margin:0px 0px 1.2em!important">Interesting. Thanks.</p>
<p style="margin:0px 0px 1.2em!important">Personally, I don’t really know how to resolve the tension between the outer pattern saying: I <em>really</em> want to be lazy; and uniformity with the unlifted-variable-binding case.</p>
<p style="margin:0px 0px 1.2em!important">The point about <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">b</code></p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code class="hljs language-haskell" style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248) none repeat scroll 0% 0%"><span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold">b</span> = <span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">let</span> ~(<span class="hljs-type" style="color:rgb(68,85,136);font-weight:bold">MkX</span> z) = undefined <span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">in</span> ()
</code></pre>
<p style="margin:0px 0px 1.2em!important">Is that it <em>cannot</em> do anything else than force the pattern. Because <code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline">b</code> is an unlifted variable, it doesn’t contain a thunk. In other words, we can read it as the pattern being lazy, but it being immediately forced. Pretty much as in:</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code class="hljs language-haskell" style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248) none repeat scroll 0% 0%"><span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold">let</span> (x,y) = undefined <span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">in</span> x `seq` ()
</code></pre>
<p style="margin:0px 0px 1.2em!important">My intuition would be that</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code class="hljs language-haskell" style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248) none repeat scroll 0% 0%"><span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold">let</span> (x, (# #)) = (<span class="hljs-number" style="color:rgb(0,128,128)">1</span>, undefined) <span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">in</span> ()
</code></pre>
<p style="margin:0px 0px 1.2em!important">converges, while</p>
<pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code class="hljs language-haskell" style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important;display:block;overflow-x:auto;padding:0.5em;color:rgb(51,51,51);background:rgb(248,248,248) none repeat scroll 0% 0%"><span class="hljs-title" style="color:rgb(153,0,0);font-weight:bold">let</span> (x, (# #)) = (<span class="hljs-number" style="color:rgb(0,128,128)">1</span>, undefined) <span class="hljs-keyword" style="color:rgb(51,51,51);font-weight:bold">in</span> x `seq` ()
</code></pre>
<p style="margin:0px 0px 1.2em!important">diverges.</p>
<p style="margin:0px 0px 1.2em!important">But I’m not exactly sure how to explain this rule succinctly. And I’m not sure it would be quite as intuitive to anybody. For starters, it seems to depart significantly from Iavor’s intuition.</p>
<div title="MDH:PGRpdiBkaXI9Imx0ciIgZ21haWxfb3JpZ2luYWw9IjEiPjxicj48L2Rpdj48ZGl2IGRpcj0ibHRy
Ij48ZGl2IGRpcj0ibHRyIj5PbiBGcmksIFNlcCA0LCAyMDIwIGF0IDU6NDcgUE0gSWF2b3IgRGlh
dGNoa2kgJmx0OzxhIGhyZWY9Im1haWx0bzppYXZvci5kaWF0Y2hraUBnbWFpbC5jb20iIHRhcmdl
dD0iX2JsYW5rIj5pYXZvci5kaWF0Y2hraUBnbWFpbC5jb208L2E+Jmd0OyB3cm90ZTo8YnI+PC9k
aXY+PGRpdiBjbGFzcz0iZ21haWxfcXVvdGUiPjxibG9ja3F1b3RlIGNsYXNzPSJnbW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