<div dir="ltr">Hi George,<div><br></div><div>here is an even simpler design!<div><span style="font-size:12.8px"><br></span></div><div><div><span style="font-size:12.8px">When `-ffull-guard-reasoning` is on, use the new pattern match checker.</span><br></div></div><div><br></div><div><span style="font-size:12.8px">When `-ffull-guard-reasoning` is off (the default), try to use the new pattern match checker, but if the number of guards is more than 20,</span></div><div><span style="font-size:12.8px">1. fall back to the old (simple) pattern match checker, and</span></div><div><span style="font-size:12.8px">2. </span><span style="font-size:12.8px">issue a `too-many-guards` warning </span></div><div><br></div><div><span style="font-size:12.8px">The warning can be turned off with `</span><span style="font-size:12.8px">-Wno-too-many-guards`.</span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">What do you think?</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Thomas</span></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Dec 19, 2015 at 7:52 PM, Thomas Miedema <span dir="ltr"><<a href="mailto:thomasmiedema@gmail.com" target="_blank">thomasmiedema@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On Mon, Dec 14, 2015 at 3:03 PM, Richard Eisenberg <span dir="ltr"><<a href="mailto:eir@cis.upenn.edu" target="_blank">eir@cis.upenn.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">1. -fwarn-pattern-guards=none<br>
2. -fwarn-pattern-guards=try<br>
3. -fwarn-pattern-guards=try-quiet<br>
4. -fwarn-pattern-guards=do   -- there is no "try"<br></blockquote><div><br></div></span><div>The <a href="https://phabricator.haskell.org/rGHC7e216050ce0366a1d2c2a971db457a5d49f60e8a" target="_blank">implementation</a> now uses: </div>1. -guard-reasoning=simple<br>2. -guard-reasoning=try<br>3. -guard-reasoning=try-quiet<br>4. -guard-reasoning=do<div><br></div><div>Since `try-quiet` suppresses a warning, it seems more consistent with the rest of the warning machinery to have a separate warning flag for it (`<span style="font-size:12.8px">-Wornate-guards`, using the new syntax from #11218), enabled by default. When </span>the fine-grained `-Werror=...` facility is implemented (#11219), this would allow you to for example say `-Werror -Wno-error=ornate-guards`, meaning: turn all warnings into errors, except for `-Wornate-guards` (but don't silence those completely!).</div><div><br></div><div>So then it would like this (with `-f` prefix preferable):</div><div>1. -fguard-reasoning=simple<br>2. -fguard-reasoning=try<br>3. -fguard-reasoning=do<br></div><div><br></div><div>And orthogonal to that: <span style="font-size:12.8px">-Wornate-guards / -Wno-ornate-guards (name to be decided), which only have an effect when `-fguard-reasoning=try` (the default).</span></div><span class="HOEnZb"><font color="#888888"><div><br></div><div>Thomas</div><div><br></div></font></span></div></div></div>
</blockquote></div><br></div></div></div>