Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tc: Allow for #_ to solve instances #3165

Merged
merged 5 commits into from
Dec 14, 2023

Conversation

mtzguido
Copy link
Member

When using typeclasses and there is a need to disambiguate one implicit
out of many, say the 3rd, we either have to provide the dictionaries of
the preceding args explicitly:

f #_ #d_int #bool

or call solve like

f #int #solve #bool

Since just using #_ for the dictionary will fail, as it will try to be
solved only by unification. This PR makes it so that using #_ for an
implicit that has a meta (tactic or attr) retains the meta, and is then
solved exactly as if nothing was provided. Then we can disambiguate the
function above as

f #_ #_ #bool

When using typeclasses and there is a need to disambiguate one implicit
out of many, say the 3rd, we either have to provide the dictionaries of
the preceding args explicitly:

  f #_ #d_int #bool

or call `solve` like

  f #int #solve #bool

Since just using `#_` for the dictionary will fail, as it will try to be
solved only by unification. This PR makes it so that using `#_` for an
implicit that has a meta (tactic or attr) retains the meta, and is then
solved exactly as if nothing was provided. Then we can disambiguate the
function above as

  f #_ #_ #bool
@mtzguido mtzguido merged commit 23a8777 into FStarLang:master Dec 14, 2023
@mtzguido mtzguido deleted the solve_underscore branch December 14, 2023 01:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant