[GHC] #7855: Use optimizer for more information about incomplete pattern matches

GHC cvs-ghc at haskell.org
Mon Apr 22 10:17:39 CEST 2013


#7855: Use optimizer for more information about incomplete pattern matches
-----------------------------+----------------------------------------------
Reporter:  ezyang            |          Owner:                         
    Type:  feature request   |         Status:  new                    
Priority:  normal            |      Component:  Compiler (Type checker)
 Version:  7.7               |       Keywords:                         
      Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple       
 Failure:  None/Unknown      |      Blockedby:                         
Blocking:                    |        Related:                         
-----------------------------+----------------------------------------------
 This mail gave me an idea that was too cute not to write down (though I
 don't expect it to be implemented any time soon),
 http://www.haskell.org/pipermail/haskell-cafe/2013-April/107775.html

 The observation is that the typechecking phase is not necessarily the best
 point in time to check for pattern coverage exhaustiveness: if we
 tentatively stub in a default case with an error, and after optimization
 passes, we find that this case has been eliminated, then in fact there was
 no pattern coverage incompleteness. So, the strategy would be to defer
 reporting certain coverage failures until we can do actually check if
 there are any problems later. Obviously if no predicates or view patterns
 (or similar things) are involved, then there is no point in attempting to
 defer it, but otherwise this could help reduce warnings in code that make
 heavy use of these features.

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



More information about the ghc-tickets mailing list