chore: avoid unfold _; infer_instance#37129
chore: avoid unfold _; infer_instance#37129JovanGerb wants to merge 7 commits intoleanprover-community:masterfrom
unfold _; infer_instance#37129Conversation
PR summary 81059bbf91Import changes for modified filesNo significant changes to the import graph Import changes for all files
|
| Current number | Change | Type |
|---|---|---|
| 32 | -1 | backward.inferInstanceAs |
| 8469 | -9 | backward.isDefEq |
| 1245 | -1 | backward.privateInPublic |
Current commit bcc1137cac
Reference commit 81059bbf91
You can run this locally as
./scripts/reporting/technical-debt-metrics.sh pr_summary
- The
relativevalue is the weighted sum of the differences with weight given by the inverse of the current value of the statistic. - The
absolutevalue is therelativevalue divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).
|
|
||
| instance [Encodable α] : Encodable (PropForm α) := | ||
| haveI : Encodable (Constructors α) := by unfold Constructors; infer_instance | ||
| haveI : Encodable (Constructors α) := inferInstanceAs <| Encodable (α ⊕ Unit ⊕ Unit ⊕ Unit) |
There was a problem hiding this comment.
Repeating what I said on zulip; should we prefer
| haveI : Encodable (Constructors α) := inferInstanceAs <| Encodable (α ⊕ Unit ⊕ Unit ⊕ Unit) | |
| haveI : Encodable (Constructors α) := inferInstanceAs <| Encodable (delta% Constructors α) |
etc?
There was a problem hiding this comment.
It doesn't save that many characters, and I think there is an advantage to being able to see directly what the instance is actually synthesizing.
Avoid the pattern
unfold _; infer_instancewhenever possible by using eitherinferInstanceAs, orderiving.