<div dir="ltr"><div>Hi Troels,</div><div><br></div><div>Sorry to hear GHC 9 didn't fix your problems! Yes, please open an issue.</div><div><br></div><div>Optimising for specific usage patterns might be feasible, although note that most often it's not the exhaustivity check that is causing problems, but the check for overlapping patterns.</div><div>At the moment the checker doesn't take shortcuts if we have -Wincomplete-patterns, but -Wno-overlapping-patterns. Maybe it could? Let's see what is causing you problems and decide then.</div><div><br></div><div>Cheers,</div><div>Sebastian<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Am So., 28. März 2021 um 15:44 Uhr schrieb Troels Henriksen <<a href="mailto:athas@sigkill.dk">athas@sigkill.dk</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Troels Henriksen <<a href="mailto:athas@sigkill.dk" target="_blank">athas@sigkill.dk</a>> writes:<br>
<br>
> It is very likely that issue 17386 is the issue. With<br>
><br>
> {-# OPTIONS_GHC -Wno-overlapping-patterns -Wno-incomplete-patterns<br>
> -Wno-incomplete-uni-patterns -Wno-incomplete-record-updates #-}<br>
><br>
> my module(s) compile very quickly. I'll wait and see if GHC 9 does<br>
> better before I try to create a smaller case (and now I at least have a<br>
> workaround).<br>
<br>
I have now tried it with GHC 9, and unfortunately it is still very slow.<br>
<br>
As time permits, I will see if I can come up with a self-contained<br>
module that illustrates the slowdown.<br>
<br>
I do have an idea for a optimisation: In all of the cases where coverage<br>
tracking takes a long time, I have a catch-all case at the bottom. I<br>
think that is a fairly common pattern, where a program tries to detect<br>
various special cases, before falling back to a general case. Perhaps<br>
coverage checking should have a short-circuiting check for whether there<br>
is an obvious catch-all case, and if so, not bother looking any closer?<br>
<br>
-- <br>
\ Troels<br>
/\ Henriksen<br>
</blockquote></div>