[GHC] #5910: Holes with other constraints
GHC
cvs-ghc at haskell.org
Fri Mar 2 17:58:19 CET 2012
#5910: Holes with other constraints
----------------------------------------+-----------------------------------
Reporter: xnyhps | Owner:
Type: feature request | Status: new
Priority: normal | Milestone:
Component: Compiler (Type checker) | Version: 7.5
Keywords: holes | Os: Unknown/Multiple
Architecture: Unknown/Multiple | Failure: Incorrect warning at compile-time
Difficulty: Unknown | Testcase:
Blockedby: | Blocking:
Related: |
----------------------------------------+-----------------------------------
Changes (by simonpj):
* difficulty: => Unknown
Comment:
Some brief responses. We may want a Skype chat.
* I think the Right Way to do this is to add a new form of constraint, as
you have done.
* I do not see why you need `tcl_holes` in the `TcLclEnv`.
* The place to report the unsolved holes is '''not''' in `TcRnDriver`,
but rather in `TcErrors`. It is a thing of beauty. The constraint solver
tries to solve the constraints, ''returning an unsolved constraint''. The
latter is passed to `reportUnsolved` and '''that''' is the place to report
any unsolved holes.
* Moreover, `TcErrors` ''already has'' a kind of error prioritisation: it
does not report ambiguity errors if it any more important errors (such as
holes) happen first: see `tryReporters` in `reportInsolsAndFlats`. So
that will deal nicely with the problem you describe.
* Finally, here's a fresh idea. If you store the `TcTypeEnv` in the
`CtOrigin` of the hole, then when you report the hole as an error you can
look at the type environment (better zonk it first) and print the types of
all locally bound identifiers. Or some. Or whatever.
So I think you can make your implementation able to do more, and yet have
less code!
Simon
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/5910#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list