[GHC] #14771: TypeError reported too eagerly
GHC
ghc-devs at haskell.org
Wed Feb 7 18:57:47 UTC 2018
#14771: TypeError reported too eagerly
-------------------------------------+-------------------------------------
Reporter: hsyl20 | Owner: (none)
Type: bug | Status: new
Priority: normal | Milestone:
Component: Compiler (Type | Version: 8.2.2
checker) | Keywords:
Resolution: | CustomTypeErrors
Operating System: Unknown/Multiple | Architecture:
Type of failure: Incorrect | Unknown/Multiple
error/warning at compile-time | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by diatchki):
For issue 1:
the high-level question is what to do when we encounter an unevaluated
type function with an error parameter (e.g., `T x (TypeError ...)`).
Currently, we always report such errors, which is simple, but probably too
eager in some cases.
I guess a better solution, although more complex, would be too look at the
available equations for `T` and see if evaluation is "stuck" due to the
type error. If so, we report the custom error. Otherwise, we leave the
expression as is. Note, however, that if we choose to not report the
custom error we'd get a rather ugly "normal" error, as GHC would still
print the description of the error (in combinator form) when it is
rendering the type.
For issue 2:
I am not sure I understand 100% what the request is. Could you give a
concrete example?
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/14771#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list