<div dir="ltr"><div>This may sound like a bizarre request, but I feel I can't be the only one.</div><div><br></div><div>I have a function called "bug". This is essentially a special case of "error", but I am disciplined and I only use this function to mark parts of my code I believe are unreachable.</div><div><br></div><div>So something like:</div><div><br></div><div><span style="font-family:monospace">data Term = X ... | Y ... | Z ...  <br></span></div><div><span style="font-family:monospace"><br></span></div><div><span style="font-family:monospace">-- the argument can only be X or Y in this part of the program<br></span></div><div><span style="font-family:monospace">f :: Term -> ...</span></div><div><span style="font-family:monospace">f (X ...) = ...<br></span></div><div><div><span style="font-family:monospace">f (Y ...) = ...</span></div><div><span style="font-family:monospace">f Z{} = bug "This should never happen (in f)"</span></div><div><br></div><div>You might hate this style of programming, and frankly I am not a fan either. But sometimes we have to write partial functions and I am at least trying to mark the cases explicitly in these cases.</div><div><br></div><div>So this is my question: if I did a good job and if the Z case above is indeed unreachable, the code coverage report will always flag it as uncovered and in the overall report this will make it harder for me to see the parts of my code which aren't covered and should be.</div><div><br></div><div>I'd like a way of marking (= generating a tick for?) every call to this function bug as covered.</div><div><br></div><div>Please let me know if there is a better place to ask this question. I checked and <a href="http://hackage.haskell.org/package/hpc">hpc</a>'s issue tracker is shared with GHC's and I wasn't sure if they'd appreciate a question there.</div><div><br></div><br>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><span style="font-size:small">Özgür Akgün</span><br></div></div></div></div></div>