
#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 goldfire): I like this idea. In certain easy cases (pattern-matching against a monomorphic type that has an obvious `Show` instance) this would be quite easy to add, I think. Harder cases would be, well, harder. But perhaps the easy case is enough. Note that it would be hard to do a check to see if a type variable is instantiated to a type that has a `Show` instance. Or, instead of using `Show`, we could use whatever GHCi's `:force` command uses to print a value. (This doesn't require a `Show` instance.) It's even conceivable to use a `Show` instance if one is obviously available and fallback to the `:force` thing otherwise. Any volunteers to concretely specify this behavior and implement? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10985#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler