[GHC] #10339: PatternSynonyms confuse exhaustiveness check

GHC ghc-devs at haskell.org
Mon Aug 10 03:47:10 UTC 2015


#10339: PatternSynonyms confuse exhaustiveness check
-------------------------------------+-------------------------------------
        Reporter:  hvr               |                   Owner:
            Type:  bug               |                  Status:  new
        Priority:  normal            |               Milestone:
       Component:  Compiler          |                 Version:  7.8.1
      Resolution:                    |                Keywords:
Operating System:  Unknown/Multiple  |            Architecture:
 Type of failure:  Incorrect         |  Unknown/Multiple
  warning at compile-time            |               Test Case:
      Blocked By:                    |                Blocking:
 Related Tickets:                    |  Differential Revisions:
-------------------------------------+-------------------------------------

Comment (by wrl314):

 Another example showing same problem with simple unidirectional pattern
 synonym:


 {{{
 data Foo2 = Foo2 Int String

 pattern F a <- Foo2 a _

 blah :: Foo2 -> Int
 blah (F a) = a + 1
 }}}

 Result:

 {{{
 Warning: Pattern match(es) are non-exhaustive
 In an equation for ‘blah’: Patterns not matched: _
 }}}

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


More information about the ghc-tickets mailing list