[GHC] #14569: refutable let bindings produce "irrefutable pattern failed" errors
GHC
ghc-devs at haskell.org
Sat Dec 9 21:34:40 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
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:
-------------------------------------+-------------------------------------
In ghc-8.2.2 (probably since ghc-8.0.1), strict pattern matches in let
bindings produce "Irrefutable pattern failed" errors.
{{{#!hs
GHCi, version 8.2.2: http://www.haskell.org/ghc/ :? for help
Prelude> :set -XBangPatterns
Prelude> let ![] = [1] in 1
*** Exception: <interactive>:2:5-13: Irrefutable pattern failed for
pattern []
}}}
In ghc-7.10.2, normal pattern match failures were produced.
{{{#!hs
GHCi, version 7.10.2: http://www.haskell.org/ghc/ :? for help
Prelude> :set -XBangPatterns
Prelude> let ![] = [1] in 1
*** Exception: <interactive>:3:5-13: Non-exhaustive patterns in pattern
binding
}}}
To my mind, the latter error makes much more sense; the effect of the ! is
to make the pattern an ordinary, refutable one. Could the old behavior be
restored?
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14569>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list