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

Remove Union Flattening #71

Open
KabirSamsi opened this issue Dec 20, 2024 · 0 comments
Open

Remove Union Flattening #71

KabirSamsi opened this issue Dec 20, 2024 · 0 comments

Comments

@KabirSamsi
Copy link
Contributor

Perhaps this merits further discussion, but having gone through this a few times, I can see no genuine advantage of making the set type recursive. We currently have

type set =
  | Class of clss
  | Union of set list

I propose it to be rewritten as

type set =
  | Class of clss
  | Union of clss list

That is to say, Union([Class 'A'; Union([Class 'B'; Class 'C'])]) should be treated as equivalent to Union([Class 'A'; Class 'B'; Class 'C']). The latter is much easier and cleaner to work with.

Part of my work this semester involved formally proving that dequeue-side semantics for flattened unions behave the same as recursive ones (i.e., showing that the two sets I described above behave the same way). So I'd feel confident in removing that.

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

No branches or pull requests

1 participant