[GHC] #8779: Exhaustiveness checks for pattern synonyms

GHC ghc-devs at haskell.org
Thu Jun 9 00:00:40 UTC 2016


#8779: Exhaustiveness checks for pattern synonyms
-------------------------------------+-------------------------------------
        Reporter:  nomeata           |                Owner:
            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):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by mpickering):

 Reid,  your first of bullet points makes a lot of sense to me but I am
 still worried about abstraction.

 For example, the only way to construct and deconstruct `Command`s is by
 using `AddOne` and `MinusOne` thus a complete
 set of patterns would be `AddOne` and `MinusOne`. When looked through,
 there are many more values which inhabit this type.
 So it seems under your proposal that this would cause a warning.

 {{{
 module M ( Command(AddOne, MinusOne) ) where

 data Command = Command String

 pattern AddOne = Command "AddOne"
 pattern MinusOne = Command "MinusOne"
 }}}

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


More information about the ghc-tickets mailing list