<div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">It seems that I can replace </div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div dir="ltr"><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><span style="font-family:Arial,Helvetica,sans-serif;font-size:small"> if null ys then [] else [(xs,tail ys)])</span></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><span style="font-family:Arial,Helvetica,sans-serif;font-size:small"><br></span></div></div></blockquote><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">with </div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">if null ys then [] else [(xs, Safe.tailErr ys)])</div></blockquote><br><div dir="ltr"><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">and not get any warnings so I think I am going to do that. I'm surprised that the warning doesn't mention that option to fix the issue. Do you see any issues with this fix?</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">Thanks,</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large">George</div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 16, 2024 at 11:57 AM George Colpitts <<a href="mailto:george.colpitts@gmail.com">george.colpitts@gmail.com</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 dir="ltr"><div style="font-family:"times new roman",serif;font-size:large">Hi Henning,</div><div style="font-family:"times new roman",serif;font-size:large"><br></div><div style="font-family:"times new roman",serif;font-size:large">Thanks for the quick response!</div><div style="font-family:"times new roman",serif;font-size:large">Yes, that's basically how I fixed it but I really don't want to have to do that since the code is correct. Not a big deal but may be irritating to beginners or large projects that want to eliminate warnings. Do you think an ER would be rejected ? If I remember correctly there is already detection of incomplete pattern matching that is ok and in such cases warnings are omitted. This would be similar to that.</div><div style="font-family:"times new roman",serif;font-size:large"><br></div><div style="font-family:"times new roman",serif;font-size:large">Cheers,</div><div style="font-family:"times new roman",serif;font-size:large">George</div><div style="font-family:"times new roman",serif;font-size:large"><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 16, 2024 at 11:46 AM Henning Thielemann <<a href="mailto:lemming@henning-thielemann.de" target="_blank">lemming@henning-thielemann.de</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"><br>
On Tue, 16 Apr 2024, George Colpitts wrote:<br>
<br>
> ghc should be able to deduce correct use of partial functions and not give a warning in such cases, e.g.<br>
> in 9.8.2<br>
> <br>
> if null ys then [] else [(xs,tail ys)])<br>
> <br>
> gets a warning<br>
> <br>
> warning: [GHC-63394] [-Wx-partial]<br>
> <br>
> but it is clear that this use of tail will never be a problem so IMHO that line of code should not get a<br>
> warning. <br>
> <br>
> Does anybody know if there is a plan or enhancement request to eliminate such warnings? <br>
<br>
<br>
I would just use good old pattern matching:<br>
<br>
case ys of<br>
[] -> []<br>
_:zs -> [(xs,zs)]</blockquote></div>
</blockquote></div></div>