[Haskell-cafe] Enable -Wall by default?
Henning Thielemann
lemming at henning-thielemann.de
Mon Dec 21 23:03:58 UTC 2020
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.
More information about the Haskell-Cafe
mailing list