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

Use structure instead of inductive where possible #4723

Open
tothtamas28 opened this issue Jan 8, 2025 · 2 comments · May be fixed by #4731
Open

Use structure instead of inductive where possible #4723

tothtamas28 opened this issue Jan 8, 2025 · 2 comments · May be fixed by #4731

Comments

@tothtamas28
Copy link
Contributor

We can map constructors whose arguments are cells to structure instead of inductive, since in this case the cell names give reasonable and unique names for fields. For example:

<generatedTop>
    <k></k>
    <generatedCounter></generatedCounter>
</generatedTop>

can become

structure SortGeneratedTopCell where
  «<generatedTop>» :: (k : SortK) (generatedCounter : SortGeneratedCounterCell)

or

structure SortGeneratedTopCell where
  mk :: (k : SortK) (generatedCounter : SortGeneratedCounterCell)

or simply

structure SortGeneratedTopCell where
  k : SortK
  generatedCounter : SortGeneratedCounterCell
@JuanCoRo
Copy link
Member

JuanCoRo commented Jan 8, 2025

I like the third option better! But might be a bit trickier to implement?

@tothtamas28
Copy link
Contributor Author

I like the third option better!

Me too. Semantically, it is actually equivalent to the second option, but reads nicer.

@tothtamas28 tothtamas28 linked a pull request Jan 9, 2025 that will close this issue
@tothtamas28 tothtamas28 linked a pull request Jan 9, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants