[GHC] #10985: When a "non-exhaustive pattern"-error occurs, output the arguments (if possible)

GHC ghc-devs at haskell.org
Mon Oct 19 18:42:10 UTC 2015


#10985: When a "non-exhaustive pattern"-error occurs, output the arguments (if
possible)
-------------------------------------+-------------------------------------
        Reporter:  Watercrystal      |                Owner:
            Type:  feature request   |               Status:  new
        Priority:  lowest            |            Milestone:
       Component:  Compiler          |              Version:  7.10.2
  (Debugging)                        |
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #10972            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by kanetw):

 A few things to consider:
 {{{#!hs
 fix :: (a -> a) -> a
 fix f = let x = f x in x

 data Nat = Z | S Nat deriving Show

 badFunction Z = undefined
 }}}

 The error for `badFunction (fix S)` would never terminate, but we can
 limit the length here. Just a thing to keep in mind, though.

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


More information about the ghc-tickets mailing list