Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,239
    • Issues 5,239
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 565
    • Merge requests 565
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #2204
Closed
Open
Issue created Apr 08, 2008 by Deewiant@trac-Deewiant

Improve 'patterns not matched' warnings

Compiling the following with -fwarn-incomplete-patterns:

module Asdf where

f :: String -> Int
f "0" = 0

g :: Int -> Int
g 0 = 0

Yields:

asdf.hs:4:0:
    Warning: Pattern match(es) are non-exhaustive
             In the definition of `f':
                 Patterns not matched:
                     []
                     (GHC.Base.C# #x) : _ with #x `notElem` ['0']
                     (GHC.Base.C# '0') : (_ : _)

asdf.hs:7:0:
    Warning: Pattern match(es) are non-exhaustive
             In the definition of `g':
                 Patterns not matched: GHC.Base.I# #x with #x `notElem` [0#]

Losing the 'GHC.Base' stuff along with the various octothorpes would make the error messages a lot nicer. Ideally it'd be something like Patterns not matched: x where x notElem [0] for the second case, for instance.

Trac metadata
Trac field Value
Version 6.8.2
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Multiple
Architecture Multiple
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking