<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jan 5, 2017 at 7:01 AM, Phil Ruffwind <span dir="ltr"><<a href="mailto:rf@rufflewind.com" target="_blank">rf@rufflewind.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Rather than deprecating a function, it would be nice to have some sort<br>
of {-# PARTIAL #-} pragma to warn the user that 'read' is a partial<br>
function (and similarly for 'head', 'tail' and its friends), much like<br>
how GHC already warns about partial case-blocks.  That being said, it's<br>
probably best to delay this until there is a way to explicitly turn of<br>
the warnings individually at the call site for those who want<br>
warning-free code.</blockquote><div><br></div><div>This strikes me as the right avenue to pursue. While I'd personally be happy to expunge partial functions from base entirely, I recognize that others have different needs - and a {-# PARTIAL #-} pragma would have broad utility. Coupled with a -fno-warn-partial flag, users would be able to opt-in to the status quo, but the default would be to steer people away from partial functions, which seems like the right thing. For new users, the warnings would be educational, since for many people coming from languages where many "functions" are partial the idea of totality is something that needs to be learned.</div><div><br></div><div>Kris</div></div></div></div>