<div dir="ltr"><div>Wouldn't you have to be able to inline null and tail to be able to say that this use of tail is not partial? If null and tail "live" in a different library, is there much that you can do?</div><div><br></div><div>Thanks,</div><div><br></div><div>Ivan<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 16 Apr 2024 at 07:58, 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 class="gmail_default" style="font-family:times new roman,serif;font-size:large">Hi Henning,</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 for the quick response!</div><div class="gmail_default" 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 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">Cheers,</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: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>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div>