-
Notifications
You must be signed in to change notification settings - Fork 404
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
feat: apply’s error message should show implicit arguments as needed #3926
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
luckily the necessary functionality already exists in the form of `addPPExplicitToExposeDiff`. Fixes #3232.
…to joachim/failed-to-unify
…to joachim/failed-to-unify
nomeata
changed the title
joachim/failed to unify2
feat: apply’s error message should show implicit arguments as needed
Apr 16, 2024
github-actions
bot
added
the
toolchain-available
A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
label
Apr 16, 2024
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/batteries
that referenced
this pull request
Apr 16, 2024
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Apr 16, 2024
leanprover-community-mathlib4-bot
added
the
builds-mathlib
CI has verified that Mathlib builds against this PR
label
Apr 16, 2024
Mathlib CI status (docs):
|
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/batteries
that referenced
this pull request
Apr 16, 2024
leanprover-community-mathlib4-bot
added a commit
to leanprover-community/mathlib4
that referenced
this pull request
Apr 16, 2024
Probably #3929 is better. |
github-merge-queue bot
pushed a commit
that referenced
this pull request
May 18, 2024
…3929) luckily the necessary functionality already exists in the form of `addPPExplicitToExposeDiff`. But it is not cheap, and we should not run this code when the error message isn’t shown, so we should do this lazily. We already had `MessageData.ofPPFormat` to assemble the error message lazily, but it was restricted to returning `FormatWithInfo`, a data type that doesn’t admit a nice API to compose more complex messages (like `Format` or `MessageData` has; an attempt to fix that is in #3926). Therefore we split the functionality of `.ofPPFormat` into `.ofFormatWithInfo` and `.ofLazy`, and use `.ofLazy` to compute the more complex error message of `apply`. Fixes #3232. --------- Co-authored-by: David Thrane Christiansen <david@davidchristiansen.dk> Co-authored-by: Wojciech Nawrocki <wjnawrocki@protonmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
builds-mathlib
CI has verified that Mathlib builds against this PR
toolchain-available
A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
luckily the necessary functionality already exists in the form of
addPPExplicitToExposeDiff
. But it is not cheap, and we should not run this codewhen the error message isn’t shown, so this used
.ofPPFormat
to assemble the errormessage lazily.
Unfortunately,
.ofPPFormat
andFormatWithInfo
have quite limited APIs for now.This PR adds
FormatWithInfo.append
in a way that renumbers the keys in theFormat
and the
infos
.This also requires
RBMap.mapKeysMono
, and I got distracted a bit by writing the voluminous but boring proofs required for that somewhat trivial operation.The lack of interpolation syntax for
FormatWithInfo
is also annoying. It would be reallynicer if one could “just” use
MessageData
in.ofPPFormat
somehow.Fixes #3232.