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

PDF cleanup 282: hide module syntax #370

Merged
merged 2 commits into from
Feb 16, 2024
Merged

Conversation

williamdemeo
Copy link
Contributor

Description

This addresses one item of issue #282.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • Code is formatted according to CONTRIBUTING.md
  • Self-reviewed the diff

This addresses one item of issue #282.
\begin{code}
module _ (khs : ℙ KeyHash) (I : Maybe Slot × Maybe Slot) where
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since this module block contains only one thing, I think it'd be better to just add these as arguments to the datatype.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(done)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh gosh, the repetition...

Also isn't it more confusing now to have the readers read "indexed constant types"?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there any repetition?

Generally I agree, but I think presenting evalTimelock as a datatype is a bad idea in the first place (why isn't it a function?). So when we have a spec that actually wants to present this there's a decent chance that we'll want to refactor this anyway.

Copy link
Collaborator

Choose a reason for hiding this comment

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

The repetition comes from the "constant" indices, s/evalTimelock/(evalTimelock khs I), which is why I used module parameters as the best practice to avoid this, and results in much more readable constructors.

Having said that, I agree that using the "call-graph view" of the function as a datatype might be a bit too much here, I don't know why Ali initially did it this way. I agree you should investigate the alternative sooner rather than later to avoid maintenance overhead.

@WhatisRT WhatisRT merged commit 6dd150b into master Feb 16, 2024
3 checks passed
@WhatisRT WhatisRT deleted the william/282-hide-module-syntax branch February 16, 2024 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants