[Haskell-cafe] ghc should be able to deduce correct use of partial functions and not give a warning in such cases

George Colpitts george.colpitts at gmail.com
Tue Apr 16 15:57:48 UTC 2024


Makes sense !

On Tue, Apr 16, 2024 at 12:45 PM Henning Thielemann <
lemming at henning-thielemann.de> wrote:

>
> On Tue, 16 Apr 2024, George Colpitts wrote:
>
> > 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.
>
> To my human linter 'tail' looks always suspicious and needs an additional
> mental check, that 'tail' is no problem in your special case. The pattern
> match does not have this problem. It both improves readability and
> convinces GHC easily. That's what the warning shall achieve and it is even
> a good guide to beginners.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20240416/2dd8b63b/attachment.html>


More information about the Haskell-Cafe mailing list