[Haskell-cafe] Configuring cabal to tell HPC to ignore certain functions
amindfv at mailbox.org
amindfv at mailbox.org
Sun Dec 29 21:32:48 UTC 2024
On Mon, Dec 30, 2024 at 07:32:01AM +1100, Viktor Dukhovni wrote:
> On Sun, Dec 29, 2024 at 12:13:35PM -0800, Ivan Perez wrote:
>
> > Wrt otherwise, yes, I also found that a bit confusing.
>
> Well, it isn't that confusing, it is a boolean function that
> has never been tested well enough to observe the effect of
> it returning False. :-) It is slightly surprising when
> first observed, but clear enough why this was flagged.
It's clear enough why this would happen, but it's serving the compiler, not the user.
On an intuitive level, you want to be able to say "I have 100% test coverage" and not waste time on what are essentially false positives.
Here's another annoying example:
main :: IO ()
main = do
_ <- foo
pure ()
The unit ("()") is marked as "never executed" and highlighted in yellow, and expression coverage falls below 100%. While that may literally be true, this falls - for the programmer just trying to get something done - under the category of "why am I looking at this?"
HPC is a great tool and a few human-aware improvements could really help quality of life (and HPC's adoption, imo).
- Tom
More information about the Haskell-Cafe
mailing list