[GHC] #14569: refutable let bindings produce "irrefutable pattern failed" errors

GHC ghc-devs at haskell.org
Mon Dec 11 12:32:31 UTC 2017


#14569: refutable let bindings produce "irrefutable pattern failed" errors
-------------------------------------+-------------------------------------
        Reporter:  int-e             |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.2.1
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
 Type of failure:  Poor/confusing    |  Unknown/Multiple
  error message                      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by int-e):

 Replying to [comment:1 simonpj]:
 > I rather agree.  Actually even 7.10 had this behaviour.  Try
 > {{{
 > main = let [x] = []
 >        in print (x::Int)
 > }}}
 > and you get the runtime crash (with 7.10)
 > {{{
 > run: T14569.hs:3:12-19: Irrefutable pattern failed for pattern [x]
 > }}}

 The difference here is that here the pattern is actually (implicitly)
 irrefutable as per the Haskell 2010 language report. However,

 > The real point is: this talk of "irrefutable" patterns is confusing,
 especially since this one is manifestly refutable.

 This is a good point, the nomenclature is quite confusing, not just for
 beginners, but for anyone who isn't intimately familiar with the section
 on pattern matching in the Haskell report. I wouldn't be sad to see those
 errors replaced by ordinary incomplete pattern match errors.

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


More information about the ghc-tickets mailing list