Is there a reason that typeclass resolution runs after tactics in terms? (match foo with bar => ltac:(let v := eval cbv [bar] in bar in idtac v; exact v) end
shows that foo
will not have typeclasses resolved at the point at which the tactic is run)
do you mean "why is it not run before" or "why is it run at all"?
I mean "why is it not run before"
That seems to conflict with "solve all TC goals at once for better errors" and "backtrack on the result of one search if dependent searches fail" (but don't ask me whether that applies here), but can't the ltac run refine to force TC search instead?
Or possibly, notypeclasses refine tm; solve [once (typeclasses eauto)]
like stdpp's TCNoBackTrack does to avoid solving unrelated evars
(source: https://gitlab.mpi-sws.org/iris/stdpp/-/blob/e00878becd64c5971940ecc62b5a1528d085d84d/stdpp/base.v#L62-94, if you enjoy cursed knowledge)
Jason Gross said:
I mean "why is it not run before"
you don't want that in general though
I mean imagine trying to do ltac:(exact (foo : P x)) : P (_ : SomeClass)
if TC inference fills the _
with y
and that's assuming it only got called on TC evars in the expected type, it's even worse if it gets called on other evars
stuff like https://github.com/coq/coq/issues/6583 seems related if you want to pass time reading issues btw
Do you know why https://github.com/coq/coq/pull/13071 was abandoned?
Last updated: Oct 13 2024 at 01:02 UTC