I tend to repeatedly typecheck my programs in a terminal whilst modifying them in my editor of choice in order to get real-time feedback. I typically run something akin to: watch -d -n 1 "ghc -fno-code NoIncompletePM.hs"
.
Unfortunately the no-code
flag which I use to avoid compiling again and again code I don't care about yet seems to be incompatible with the warn-incomplete-patterns
one. E.g. with this program:
{-# OPTIONS -Wall #-}
module NoIncompletePM where
argh :: Bool -> Bool
argh True = True
I never get any warning that argh
is missing a case for False
. It is possible to get all of these warnings by removing the no-code
flag and adding the force-recomp
one (so that the warning is displayed every single time and not just the first time it's compiled) but I precisely want to avoid compiling this code...
I could not find anything in the manual describing these as being incompatible so I'm guessing that it's either an unexpected behaviour or I am doing something wrong. Any clues?
This is a known ghc bug:
https://ghc.haskell.org/trac/ghc/ticket/8101
Note that if you pass the -c
flag for one-shot mode, then you do get warnings. So that's a workaround for now.
Sadly, it appears (https://ghc.haskell.org/trac/ghc/ticket/10600) that ghc 8.0 may rebreak this working even in one-shot mode, at least for one more release cycle.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With