[GHC] #7085: Report unused pattern bindings

GHC cvs-ghc at haskell.org
Fri Jul 20 13:53:28 CEST 2012


#7085: Report unused pattern bindings
---------------------------------+------------------------------------------
    Reporter:  simonpj           |       Owner:                  
        Type:  feature request   |      Status:  new             
    Priority:  normal            |   Milestone:                  
   Component:  Compiler          |     Version:  7.4.2           
    Keywords:                    |          Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |     Failure:  None/Unknown    
  Difficulty:  Unknown           |    Testcase:                  
   Blockedby:                    |    Blocking:                  
     Related:                    |  
---------------------------------+------------------------------------------
 Henning says: recently, I was a bit suprised that GHC didn't warn about
 useless
 `where` definitions such as the following when using `-Wall` (and I
 couldn't find a respective warning GHC CLI flag which would have
 enabled reporting a warning in this case -- unless I missed it)
 {{{
 module Foo where

 foo :: Int -> Int
 foo n = n + 1
    where
      Nothing = Just n
 }}}
 I think that there should be a warning for the unused pattern binding.

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



More information about the Glasgow-haskell-bugs mailing list