[GHC] #15884: Completeness of View Patterns With a Complete Set of Output Patterns

GHC ghc-devs at haskell.org
Fri Nov 9 21:13:31 UTC 2018


#15884: Completeness of View Patterns With a Complete Set of Output Patterns
-------------------------------------+-------------------------------------
           Reporter:  Shayan-Najd    |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:  8.6.3
          Component:  Compiler       |           Version:  8.6.2
           Keywords:                 |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 For example, the code

 {{{#!hs
 {-# OPTIONS_GHC -Wall #-}
 {-# LANGUAGE ViewPatterns #-}
 f :: Maybe a -> Bool
 f (id->Nothing)  = False
 f (id->(Just _)) = True
 }}}

 mistakenly returns the warning

 {{{
 warning: [-Wincomplete-patterns]
     Pattern match(es) are non-exhaustive
     In an equation for ‘f’: Patterns not matched: _
   |
 4 | f (id->Nothing)  = False
   | ^^^^^^^^^^^^^^^^^^^^^^^^...
 }}}

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


More information about the ghc-tickets mailing list