Karoy Lorentey
876177dbb5
[PersistentSet] Test & fix symmetricDifference
2022-09-28 18:38:14 -07:00
Karoy Lorentey
d6b1e6c767
[PersistentSet] Add some documentation
2022-09-28 18:37:49 -07:00
Karoy Lorentey
562b21e70f
[PersistentCollections] filter, intersection, subtracting: Don’t build a result node until we know for sure we won’t just clone self
2022-09-28 14:45:44 -07:00
Karoy Lorentey
4a4c4a75fd
[PersistentSet] Add tests for union; fix issues
2022-09-27 23:02:40 -07:00
Karoy Lorentey
a887a77ef5
[PersistentSet] Add tests for intersection & subtracting; fix issues
2022-09-27 14:18:40 -07:00
Karoy Lorentey
83601d9d3e
[PersistentSet] Add fluent set operations (untested)
2022-09-27 14:18:39 -07:00
Karoy Lorentey
03c1bd958a
[PersistentSet] Implement structural union operation (untested)
2022-09-27 14:18:39 -07:00
Karoy Lorentey
590dfeb031
[PersistentSet] Implement (naive) union, symmetricDifference operations (untested)
2022-09-24 17:11:46 -07:00
Karoy Lorentey
c92b0fa99a
[PersistentSet] Implement structural subtraction, intersection, filtering (untested)
2022-09-24 17:11:10 -07:00
Karoy Lorentey
3d10964905
[PersistentSet] Flesh out isSubset/iSuperset/isDisjoint/etc overloads (untested)
...
This adds an experimental _FastMembershipCheckable protocol to speed
up these relationship predicates when possible — having separate
overloads for each known collection with a fast containment check
is not going to scale for long.
This commit also introduces a set of isEqual(to:) methods that
generalize ==.
2022-09-24 17:02:16 -07:00
Karoy Lorentey
00ae83df1e
[PersistentSet] Add ExpressibleByArrayLiteral, Codable, Custom[Debug]StringConvertible, CustomReflectable conformances
2022-09-24 17:02:15 -07:00
Karoy Lorentey
9150bbf06e
[PersistentCollections] Cache the item hash within collision nodes
...
This will simplify merge operations as we no longer have to spend effort on preventing repeated rehashings of items within collision nodes.
Also, review and simplify node allocation and lookup code.
2022-09-23 11:15:56 -07:00
Karoy Lorentey
77f205f45e
[PersistentCollections] Implement structural index(_:offsetBy:) & index(_:offsetBy:limitedBy:)
2022-09-23 11:15:46 -07:00
Karoy Lorentey
de136505c0
[PersistentCollections] _Node.isEqual: Don’t allow customizing key comparisons; add a fast path for collision nodes
2022-09-22 16:33:59 -07:00
Karoy Lorentey
958fd47539
[PersistentSet] Start drafting the new type
2022-09-21 10:45:20 -07:00