Skip to content

Warnings now confusingly mention GHC.Internal

Summary

Some warnings, such as the one for using head, now reference GHC.Internal names instead of the corresponding public names:

<interactive>:1:15: warning: [GHC-63394] [-Wx-partial]
    In the use of ‘head’
    (imported from Prelude, but defined in GHC.Internal.List):
    "This is a partial function, it throws an error on empty lists. Use pattern matching, 'GHC.Internal.Data.List.uncons' or 'GHC.Internal.Data.Maybe.listToMaybe' instead. Consider refactoring to use "Data.List.NonEmpty"."

Steps to reproduce

Compile this code: main = pure $ head [()]

Expected behavior

I expect the warning to mention the public names, like it did in GHC 9.8.2:

<interactive>:1:15: warning: [GHC-63394] [-Wx-partial]
    In the use of ‘head’
    (imported from Prelude, but defined in GHC.List):
    "This is a partial function, it throws an error on empty lists. Use pattern matching or Data.List.uncons instead. Consider refactoring to use Data.List.NonEmpty."

Environment

  • GHC version used: 9.10.0.20240328

Optional:

  • Operating System: Linux
  • System Architecture: x86_64
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information