Task
Implement set operations on Set[T]: union, intersection, and difference.
These are defined in PDP-009 but deferred to a later implementation milestone.
Acceptance criteria
s.union(other) -> Set[T] — elements in either set
s.intersection(other) -> Set[T] — elements in both sets
s.difference(other) -> Set[T] — elements in s but not in other
- All three return a new
Set[T] (non-mutating)
- Both sets must have the same element type
T
Spec
See PDP-009: Collection Types — Set operations section.
Note: This is tracked here but implementation is deferred until Set[T] core (#45) is complete.
Task
Implement set operations on
Set[T]:union,intersection, anddifference.These are defined in PDP-009 but deferred to a later implementation milestone.
Acceptance criteria
s.union(other) -> Set[T]— elements in either sets.intersection(other) -> Set[T]— elements in both setss.difference(other) -> Set[T]— elements insbut not inotherSet[T](non-mutating)TSpec
See PDP-009: Collection Types — Set operations section.
Note: This is tracked here but implementation is deferred until
Set[T]core (#45) is complete.