[GHC] #5724: Confusing warning message for incomplete patterns

GHC cvs-ghc at haskell.org
Sun Dec 25 03:20:33 CET 2011


#5724: Confusing warning message for incomplete patterns
------------------------------+---------------------------------------------
 Reporter:  AntoineLatter     |          Owner:                  
     Type:  bug               |         Status:  new             
 Priority:  normal            |      Component:  Compiler        
  Version:  7.3               |       Keywords:                  
       Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
  Failure:  None/Unknown      |       Testcase:                  
Blockedby:                    |       Blocking:                  
  Related:                    |  
------------------------------+---------------------------------------------

Comment(by AntoineLatter):

 Strings are also weird. We show the error for primitive chars, which is
 one problem. Bonus points for adding a special case for lists of chars.

 {{{
 g :: String -> Bool
 g "Hello" = True
 g "World" = False
 }}}

 {{{
     Warning: Pattern match(es) are non-exhaustive
              In an equation for `g':
                  Patterns not matched:
                      []
                      (GHC.Types.C# #x) : _ with #x `notElem` ['H', 'W']
                      [GHC.Types.C# 'H']
                      (GHC.Types.C# 'H') : ((GHC.Types.C# #x) : _)
                      with
                      #x `notElem` ['e']
                      ...
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5724#comment:1>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the Glasgow-haskell-bugs mailing list