[GHC] #11245: Non-exhaustive pattern, "Patterns not matched" list is empty

GHC ghc-devs at haskell.org
Fri Dec 18 11:59:34 UTC 2015


#11245: Non-exhaustive pattern, "Patterns not matched" list is empty
-------------------------------------+-------------------------------------
        Reporter:  osa1              |                Owner:  gkaracha
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.11
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by gkaracha):

 Yes, this will probably not be fixed. It is not exactly a bug:

 Since `a` is a nullary function, there is nothing to print.
 The only possible thing to print would be something like:
 {{{#!hs
 Exhaustive.hs:10:7: warning:
     Pattern match(es) are non-exhaustive
     In an equation for `a': Patterns not matched:
       ???      where (x ~ Just i) && (not (odd i))
 }}}

 but there is nothing to actually print as a pattern because you have zero
 arguments.

 Additionally, you wrote **"UPDATE: I just realized it's actually worse
 that I first thought.
 If I change a in this example: {...} This message is printed: {...}"** but
 the following gives no warning on my computer:
 {{{#!hs
 let a | Just i  <- x
       = True
       | Nothing <- x
       = False
 }}}

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


More information about the ghc-tickets mailing list