[GHC] #11390: GHC does not warn about redundant patterns

GHC ghc-devs at haskell.org
Sat Jan 9 17:36:07 UTC 2016


#11390: GHC does not warn about redundant patterns
-------------------------------------+-------------------------------------
        Reporter:  Iceland_jack      |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.1
      Resolution:                    |             Keywords:  warnings
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 rwbarton):

 I would say that `case x of {}` is just a case expression with no
 alternatives. It is, itself, still an ordinary expression. So both
 versions look like `sillyId x = <expr>` and should be equivalent as far as
 redundancy of the ''outer'' pattern match, the one done by `sillyId`, is
 concerned. Since you cannot write a definition with 0 equations, this
 "redundancy" is unavoidable. (Unless you use LambdaCase and EmptyCase, I
 guess.)

 Are you suggesting treating `case x of {}` as some kind of special form?

 Also, I'm not sure a "stuck" type family application is really empty in
 the same sense as an empty data type. But #10746 makes it hard to tell
 what GHC thinks about this.

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


More information about the ghc-tickets mailing list