<div dir="ltr"><div class="gmail_default" style="font-family:times new roman,serif;font-size:large">Thanks for everybody's replies</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">To give more context the original code from Ch. 12 of Bird's <i>Thinking Functionally with Haskell</i> was:</div><div class="gmail_default" style="font-family:times new roman,serif;font-size:large"><blockquote style="font-family:Arial,Helvetica,sans-serif;font-size:small;margin:0px 0px 0px 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br class="gmail-Apple-interchange-newline">let (xs, ys) = break (== ch) str in</div></blockquote><div class="gmail_default"> if null ys then [] else [(xs, tail ys)])</div></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">I replaced it 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">let (xs, ys@(_ : t)) = break (== ch) str in</div></blockquote><div class="gmail_default" style="font-family:times new roman,serif;font-size:large"> if null ys then [] else [(xs, t)])<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 16, 2024 at 10:51 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 class="gmail_default" style="font-family:"times new roman",serif;font-size:large">ghc should be able to deduce correct use of partial functions and not give a warning in such cases, e.g. in 9.8.2<br></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"> if null ys then [] else [(xs,tail ys)])</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">gets a warning</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"> warning: [GHC-63394] [-Wx-partial]</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">but it is clear that this use of tail will never be a problem so IMHO that line of code should not get a warning. </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">Does anybody know if there is a plan or enhancement request to eliminate such warnings? </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 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"><br></div><div class="gmail_default" style="font-family:"times new roman",serif;font-size:large"><br></div></div>
</blockquote></div>