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

Code cleanup in notations: use records instead of tuples for entries and subentries #17823

Conversation

herbelin
Copy link
Member

@herbelin herbelin commented Jul 6, 2023

This was suggested by @proux01 in this comment of #17117 and this makes explicit when entries (equivalent of in entry at level nn) and subentries (equivalent of id entry at level nn) matter in the code.

No semantic change.

Overlay:

@herbelin herbelin added kind: cleanup Code removal, deprecation, refactorings, etc. part: notations The notation system. request: full CI Use this label when you want your next push to trigger a full CI. labels Jul 6, 2023
@herbelin herbelin added this to the 8.19+rc1 milestone Jul 6, 2023
@herbelin herbelin requested review from a team as code owners July 6, 2023 19:34
@coqbot-app coqbot-app bot added the needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. label Jul 6, 2023
@herbelin herbelin force-pushed the master+cleanup-use-record-for-notation_entry_level branch from 0b9986c to 99ed573 Compare July 6, 2023 19:40
@coqbot-app coqbot-app bot removed needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. request: full CI Use this label when you want your next push to trigger a full CI. labels Jul 6, 2023
type notation_entry_level = {
notation_entry : notation_entry;
notation_level : entry_level;
}
Copy link
Member

@ejgallego ejgallego Jul 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@herbelin if you have the energy, the form:

module Entry_level = struct
  type t = { entry : notation_entry;
           ; level : entry_level
           }
end

tends to work better.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't buy the "; ..." formatting which moreover is not the most "standard" way to format records in the code of Coq.

Otherwise, what are the pros and cons of using a module? And how do you measure the "better"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using a module only makes sense if you have functions directly related to it together. If it is just a one off type its probably not worth it.

@proux01 proux01 self-assigned this Jul 7, 2023
proux01 added a commit to proux01/coq-elpi that referenced this pull request Jul 7, 2023
@coqbot-app coqbot-app bot added the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label Jul 7, 2023
@proux01
Copy link
Contributor

proux01 commented Jul 7, 2023

@coqbot run full ci

@coqbot-app coqbot-app bot removed the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label Jul 7, 2023
@coqbot-app
Copy link
Contributor

coqbot-app bot commented Jul 7, 2023

The job library:ci-fiat_crypto_legacy has failed in allow failure mode
ping @JasonGross

@proux01
Copy link
Contributor

proux01 commented Jul 8, 2023

@coqbot merge now

@coqbot-app coqbot-app bot merged commit 2568c33 into coq:master Jul 8, 2023
33 checks passed
@coqbot-app
Copy link
Contributor

coqbot-app bot commented Jul 8, 2023

@proux01: Please take care of the following overlays:

  • 17823-herbelin-record-notation.sh

gares added a commit to LPCIC/coq-elpi that referenced this pull request Jul 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: cleanup Code removal, deprecation, refactorings, etc. part: notations The notation system.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants