Skip to content

x-partial warnings with GHC 9.8 #56

Open
andreasabel/HUnit
#1
@andreasabel

Description

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
   |                                         ^^^^

| null as = ta f (c:bs) "" cs
| otherwise = ta f (c:bs) (tail as) cs

This false alarm can be addressed by using drop 1 and merging the last two cases.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions