[GHC] #13680: Can't use TypeApplications with [] data constructor

GHC ghc-devs at haskell.org
Tue Jul 11 02:10:46 UTC 2017


#13680: Can't use TypeApplications with [] data constructor
-------------------------------------+-------------------------------------
        Reporter:  RyanGlScott       |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler (Type    |              Version:  8.0.1
  checker)                           |             Keywords:
      Resolution:                    |  TypeApplications
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  GHC rejects       |  Unknown/Multiple
  valid program                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------
Changes (by RyanGlScott):

 * cc: mpickering (added)


Comment:

 Huh, I certainly didn't realize that lists were unique in this regard. In
 fact, the warning even goes away if you replace `[]` with an empty string
 literal!

 {{{
 λ> case [] of (_:_) -> case () of a -> undefined

 <interactive>:5:12: warning: [-Woverlapping-patterns]
     Pattern match is redundant
     In a case alternative: (_ : _) -> ...
 *** Exception: <interactive>:5:1-45: Non-exhaustive patterns in case

 λ> case "" of (_:_) -> case () of a -> undefined
 *** Exception: <interactive>:6:1-45: Non-exhaustive patterns in case
 }}}

 In that case, I'm slightly more comfortable with making this change. But
 just in case, I'll cc mpickering, the author of the `T12957` test, to make
 sure he's comfortable with this idea.

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


More information about the ghc-tickets mailing list