[GHC] #15613: GHCi command, tracing steps of instance resolution for Constraint or expression
GHC
ghc-devs at haskell.org
Tue Sep 11 20:56:06 UTC 2018
#15613: GHCi command, tracing steps of instance resolution for Constraint or
expression
-------------------------------------+-------------------------------------
Reporter: Iceland_jack | Owner: (none)
Type: feature request | Status: new
Priority: lowest | Milestone:
Component: GHCi | Version:
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: #15610 | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by simonpj):
I think you might want something more like `simplifyDefault` or
`solveWanteds`, both exported by `TcSimplify`.
Mostly these functions are used ''within'' the typechecker, but the
pattern match overlap checker uses the constraint solver in
`Check.tyOracle`.
A significant factor is whether you want any "givens"; that is, do you
want to explain why a constraint fails to be solved under a GADT match, or
in a function with a given context.
Once you get deeper into the constraint solver, solving one step of each
individual constraint, you need the `TcS` monad, which holds the inert
set... I'm not sure you want to get into that. Better to tell the
constraint solver to try to solve, and see what is left over: it'll return
(a) any unsolved constraints and (b) evidence bindings that amount to a
specification of the exact proof that it came up with; i.e. the tree you
want to display.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/15613#comment:9>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list