Re: ghc should be able to deduce correct use of partial functions and not give a warning in such cases
George Colpitts <[email protected]>
| Newsgroups | gmane.comp.lang.haskell.cafe |
|---|---|
| Message-ID | <CAB-d4A5+pn5PRW4R9fUpiTHCL19CAsqHM_5T=y-3iVWie4SX=A@mail.gmail.com> |
Makes sense ! On Tue, Apr 16, 2024 at 12:45 PM Henning Thielemann < [email protected]> 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. _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.