-
Notifications
You must be signed in to change notification settings - Fork 685
Use custom exception for warn-as-error instead of user_err + polymorphic maps #17141
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
Conversation
I guess indeed that's better, couple of comments:
|
I guess instead of type v = ..
val printers : (v -> pp option) list ref we could have something like type _ tag = ..
type v = V : 'a tag * 'a -> v
val printers : (polymorphic map from 'a tag to 'a) ref polymorphic map kinda like in #17145 |
IMVHO that would be nice, also for errors. I'm still hoping to make progress one day on #12602 , which could use such a map, as I'd like for IDEs to have the choice to have a richer structure to handle error messages (and actions). |
@coqbot bench |
1 similar comment
@coqbot bench |
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.
LGTM , I guess @ppedrot wants to have a look at this too.
Maybe it would be better not to expose find
but just find_opt
so we force callers to handle Not_found
?
🏁 Bench results:
INFO: failed to install coq-vst 🐢 Top 25 slow downs
🐇 Top 25 speed ups
|
This may be a little faster if some tactic code is using warn-as-error for flow control, but mostly it's because we prefer to avoid user_err.
387c953
to
7deddf5
Compare
@coqbot bench |
🏁 Bench results:
INFO: failed to install coq-vst 🐢 Top 25 slow downs
🐇 Top 25 speed ups
|
7deddf5
to
4dcb9f2
Compare
@coqbot bench |
let key t = Obj.Extension_constructor.(id (of_val t)) | ||
let onekey t = key (tag_of_onetag t) | ||
|
||
module M = Int.Map |
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.
Using Int.Map on the extension constructor feels cleaner than HMap using polymorphic compare and hash
🏁 Bench results:
INFO: failed to install coq-vst 🐢 Top 25 slow downs
🐇 Top 25 speed ups
|
@ppedrot want to have a look at this? |
4dcb9f2
to
7e2dde1
Compare
@coqbot run full ci |
fiat-crypto needs to be cut down. |
This may be a little faster if some tactic code is using warn-as-error
for flow control, but mostly it's because we prefer to avoid user_err.