Skip to content

Remove Union Flattening #71

@KabirSamsi

Description

@KabirSamsi

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions