[Haskell-cafe] Enable -Wall by default?

David Feuer david.feuer at gmail.com
Mon Dec 21 23:28:12 UTC 2020


I think the git pull request cycle provides a great deadline for warnings.
Well-run projects typically expect code to be -Wall clean before being
merged. That sort of discipline is good for personal projects
too—everything should be clean before merging a feature branch to the main
one.

On Mon, Dec 21, 2020, 6:04 PM Henning Thielemann <
lemming at henning-thielemann.de> wrote:

>
> On Thu, 10 Dec 2020, Fumiaki Kinoshita wrote:
>
> > [0] https://www.snoyman.com/blog/2020/12/haskell-bad-parts-3
>
> He's pretty right about pattern matching and -Wall and
> -Wincomplete-uni-patterns and -Wpartial-fields. It's surprising that the
> two latter ones are not part of -Wall. But this is not your proposal.
>
> I have always -Wall on, especially during early development. I can ignore
> warnings. But I will always remove the cause for warnings before making a
> commit. Warnings remind me on the unfinished bits. Thus also warnings
> about unused imports, unused parameters, unused functions are very
> important for me.
>
> I would even like to see some warnings before or along type errors.
> Currently warnings are shown only after the type errors are resolved.
> However, sometimes I get very complicated type errors but actually the
> warning "variable x unused" (and thus type inference could not take place)
> would be much more helpful.
>
> I have also taught programming to students. They often like to first run
> and test their programs and then resolve warnings somewhen in the future
> (or not at all). They are surprised why their programs don't work, whereas
> the warnings would directly point them to the problems. But -Wall is
> disabled by default. And thus making code warning free looks like an
> optional extra.
>
> On the other hand I do not know how GHC with -Wall as default affects the
> tons of packages that are already released.
> _______________________________________________
> 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20201221/500e6a5b/attachment.html>


More information about the Haskell-Cafe mailing list