-
Notifications
You must be signed in to change notification settings - Fork 388
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 #3929
Conversation
luckily the necessary functionality already exists in the form of `addPPExplicitToExposeDiff`. Fixes #3232.
…to joachim/failed-to-unify
…to joachim/failed-to-unify
Mathlib CI status (docs):
|
Co-authored-by: David Thrane Christiansen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! I have re-fetched the pretty-printing infrastructure into my mental cache and I think I agree that this is the right-est solution. Just to confirm though, why did you discard #3926? Is it because that still doesn't allow for lazily-produced MessageData
, only FormatWithInfos
, and furthermore introduced yet another appendable message type?
Co-authored-by: Wojciech Nawrocki <[email protected]>
Thanks! It's good to have a second pair of eyes!
Yes! The way |
I have made adaptations to batteries and to mathlib4, and written a changelog. If these build, I think we should be good. But, it would still be good to benchmark as |
!bench |
Here are the benchmark results for commit 8316658. |
Mathlib seems to be happy as well, thanks. Any last thoughts before I press the button? |
LGTM! |
Thanks for your help getting this over the finishing line. We should probably now make the |
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 we should do this lazily.
We already had
MessageData.ofPPFormat
to assemble the error message lazily, but itwas restricted to returning
FormatWithInfo
, a data type that doesn’t admit a niceAPI to compose more complex messages (like
Format
orMessageData
has; an attempt tofix 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 ofapply
.Fixes #3232.