<div dir="ltr">Ah, yes, quite right: since the projections match the whole patterns, the bang patterns in a constructor would be forced as soon as one of the fields in the constructor is used, so this also diverges:<div><br></div><div>ex3 = let (x, !y) = (5,undefined) in x</div><div><br></div><div>The rule is consistent, to me it just seems quite unintuitive.</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 10, 2020 at 9:18 AM Richard Eisenberg <<a href="mailto:rae@richarde.dev">rae@richarde.dev</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="overflow-wrap: break-word;">This whole area is clearly somewhat troublesome:<div><div><br><blockquote type="cite"><div>On Sep 10, 2020, at 12:05 PM, Iavor Diatchki <<a href="mailto:iavor.diatchki@gmail.com" target="_blank">iavor.diatchki@gmail.com</a>> wrote:</div><br><div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">3. nested bang patterns in pattern bindings should count as "uses" of the value and therefore should be strict.  For example if I write `let ( !x, !y ) = undefined in ()`, I think this should be equivalent to `let (x,y) = undefined in x `seq` y `seq` ()`.  With the current behavior the bang patterns don't do anything, while my guess would be that most people would expect the suggested behavior instead.  As usual, we should not allow that at the top level.</span></div></blockquote></div><br></div><div>This isn't quite right.</div><div><br></div><div>Consider</div><div><br></div><div><div></div></div><blockquote type="cite"><div><div>ex0 = let ( !x, !y ) = undefined in ()</div><div>ex1 = let ( !x, !y ) = (5, undefined) in x</div><div>ex2 = let ( !x, y )  = (5, undefined) in x</div></div></blockquote><div><br></div><div>ex0 converges, because let-bindings are lazy by default.</div><div>ex1 diverges, because the bang on y means that, when the patten-match happens at all, x and y are bound strictly. So bangs *do* matter in nested patterns within pattern bindings. By contrast, ex2 converges.</div><div><br></div><div>Again, I'm not arguing in favor of the current behavior, but I want to make sure we're all as informed as possible in this debate.</div><div><br></div><div>Richard</div></div></blockquote></div>