[GHC] #8779: Exhaustiveness checks for pattern synonyms

GHC ghc-devs at haskell.org
Fri Jan 6 19:02:05 UTC 2017


#8779: Exhaustiveness checks for pattern synonyms
-------------------------------------+-------------------------------------
        Reporter:  nomeata           |                Owner:  mpickering
            Type:  feature request   |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  7.8.1
  checker)                           |             Keywords:
      Resolution:                    |  PatternSynonyms
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):  Phab:D2669
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by rwbarton):

 And just to say it explicitly, GHC understanding that really doesn't have
 anything to do with pattern synonyms at all. Even if you write a pattern
 match like
 {{{#!hs
 f (g -> True) = 1
 f (g -> False) = 2
 }}}
 the exhaustiveness checker thinks there are unmatched cases, but it should
 be able to see that there aren't. (And the desugarer already turns this
 into a `case` that evaluates `g` only once, so it really seems like the
 exhaustiveness checker ought to be able to handle this!)

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


More information about the ghc-tickets mailing list