HUnit icon indicating copy to clipboard operation
HUnit copied to clipboard

`x-partial` warnings with GHC 9.8

Open andreasabel opened this issue 2 years ago • 1 comments

src/Test/HUnit/Terminal.hs:41:41: warning: [GHC-63394] [-Wx-partial]
    In the use of ‘tail’
    (imported from Prelude, but defined in GHC.List):
    "This is a partial function, it throws an error on empty lists. Replace it with drop 1, or use pattern matching or Data.List.uncons instead. Consider refactoring to use Data.List.NonEmpty."
   |
41 |     | otherwise          = ta f (c:bs) (tail as) cs
   |                                         ^^^^

https://github.com/hspec/HUnit/blob/95cbdaf433f18569ba6e28eb15e7fd21ff86c4a4/src/Test/HUnit/Terminal.hs#L40-L41 This false alarm can be addressed by using drop 1 and merging the last two cases.

andreasabel avatar Sep 30 '23 10:09 andreasabel

PR welcome.

sol avatar Jul 29 '24 22:07 sol