Karoy Lorentey
d05cba098a
Merge pull request #195 from lorentey/fix-bitset-shrinking-issue
...
[BitSet] Fix invariant violation in member subscript
2022-10-09 16:41:50 -07:00
Karoy Lorentey
1b71d2cd94
[BitSet] Fix invariant violation in member subscript
2022-10-09 16:12:17 -07:00
Karoy Lorentey
92210c5ca3
Merge pull request #194 from lorentey/heap-module
...
Rename `PriorityQueueModule` to `HeapModule`
2022-10-09 16:04:49 -07:00
Karoy Lorentey
c7c0a094f9
Update Xcode schemes
2022-10-09 15:44:56 -07:00
Karoy Lorentey
33b759b842
[Heap] PriorityQueueModule → HeapModule
2022-10-09 15:44:44 -07:00
Karoy Lorentey
40811cfafa
Merge pull request #193 from lorentey/fleshing-out-PersistentSet
...
Fleshing out `PersistentSet`
2022-10-09 15:41:42 -07:00
Karoy Lorentey
0b86bb11d2
[PersistentSet] Flesh out API surface
...
Add customary overloads for high-level Set operations.
2022-10-09 15:26:32 -07:00
Karoy Lorentey
c1b8d2aa9c
[PersistentSet] Round out Collection conformance with underscored requirements
...
The two highlights are _customIndexOfEquatableElement and _customLastIndexOfEquatableElement, speeding up the implementation of `firstIndex(of:)` and `lastIndex(of:)`.
2022-10-09 15:23:12 -07:00
Karoy Lorentey
d7dbaee8b9
[PersistentCollections] Minor enhancements
2022-10-09 15:20:40 -07:00
Karoy Lorentey
78a29df59b
Merge pull request #192 from lorentey/set-API-checker
...
[test] Check baseline API expectations for set-like types
2022-10-09 13:45:20 -07:00
Karoy Lorentey
4604c1bc38
[test] Add SetAPIChecker protocol
...
This is useful for validating the API surface of set-like types,
ensuring that we haven’t forgotten to implement members that
are part of users’ baseline expectations.
To ensure maximum utility, this protocol refines neither Collection
nor SetAlgebra.
2022-10-09 13:33:23 -07:00
Karoy Lorentey
78ac2eaed7
[BitSet] Add remove(at:) implementation
2022-10-09 13:20:12 -07:00
Karoy Lorentey
674e5b642b
Merge pull request #191 from lorentey/sendable
...
Add Sendable conformances to all public types
2022-10-07 10:02:39 -07:00
Karoy Lorentey
9b7c6ecb10
[SortedDictionary] SortedDictionary, .Iterator, .Index, .SubSequence, .SubSequence.Iterator, .Keys, .Keys.Iterator, .Values, .Values.Iterator: Explicitly conform to Sendable when Key and Value are both Sendable
2022-10-05 11:51:19 -07:00
Karoy Lorentey
58f7cf5a92
[SortedSet] SortedSet, .Iterator, .Index, .SubSequence, .SubSequence.Iterator: Explicitly conform to Sendable when Element is Sendable
2022-10-05 11:48:54 -07:00
Karoy Lorentey
3238b9b575
[PersistentDictionary] PersistentDictionary, .Iterator, .Index, .Keys, .Keys.Iterator, .Values, .Values.Iterator: Explicitly conform to Sendable when Key and Value are both Sendable
2022-10-05 11:46:43 -07:00
Karoy Lorentey
4b04acfe65
[PersistentSet] PersistentSet, .Iterator, .Index: Explicitly conform to Sendable where Element is Sendable
2022-10-05 11:45:23 -07:00
Karoy Lorentey
17b6c8f5c7
[OrderedDictionary] OrderedDictionary, .Iterator, .Values, .Elements, .Elements.SubSequence, .Elements.SubSequence.Iterator: Explicitly conform to Sendable when Element is Sendable
2022-10-05 11:44:06 -07:00
Karoy Lorentey
82aae27cff
[OrderedSet] OrderedSet, .SubSequence, .UnorderedView, .UnstableInternals: Explicitly conform to Sendable when Element is Sendable
2022-10-05 11:39:03 -07:00
Karoy Lorentey
a586afc5bf
[Heap] Heap: Explicitly conform to Sendable when Element is Sendable
2022-10-05 11:36:31 -07:00
Karoy Lorentey
da5284d433
[Deque] Deque, Deque.Iterator: Explicitly conform to Sendable when Element is Sendable
2022-10-05 11:35:54 -07:00
Karoy Lorentey
d2d2da6f3f
[BitSet] BitSet, BitSet.Iterator, BitSet.Index, BitSet.Counted: Explicitly conform to Sendable
2022-10-05 11:33:49 -07:00
Karoy Lorentey
14432582dc
[BitArray] Explicitly conform to Sendable
2022-10-05 11:33:31 -07:00
Karoy Lorentey
f248765da0
Merge pull request #188 from lorentey/PersistentCollections-updates
...
Persistent collections updates (part 9)
2022-10-01 12:41:00 -07:00
Karoy Lorentey
f71ebd9494
[PersistentDictionary] Implement structural merge operations
...
Merging is best done in-place, as merging a non-empty dictionary will
always mutate the dictionary, so we don’t have to tiptoe around
uniqueness issues.
(The union operation on PersistentSet is vaguely similar, but not
quite — unlike with merge, union is able directly link shared subtrees
into the result. However, a similar optimization may be worthwhile for
symmetricDifference.)
2022-09-30 19:55:04 -07:00
Karoy Lorentey
963011b1e5
[PersistentSet] insert: Don’t invalidate indices when the inserted member already exists
2022-09-30 12:20:12 -07:00
Karoy Lorentey
6dfad714a1
[PersistentCollections] _Node.update → _Node.updateValue
...
To prevent confusion with the low-level _Node.update method.
This also switches PersistentSet.insert to use `_Node.insert` instead of `_Node.updateValue`, to fix its semantics. `insert` no longer invalidates indices when the new member already exists in the collection.
2022-09-30 12:19:40 -07:00
Karoy Lorentey
8e3e205954
[PersistentCollections] Add missing import
2022-09-29 17:54:08 -07:00
Karoy Lorentey
19c9f282c9
Delete _FastMembershipCheckable
...
We don’t actually need this, as `_customContainsEquatableElement`
returning non-nil is a perfectly suitable indication that containment
checking is fast.
2022-09-29 17:37:48 -07:00
Karoy Lorentey
81acdb7f8d
[PersistentSet] Implement structural symmetricDifference
...
I think this may be the last missing non-trivial algorithm for this module.
2022-09-29 17:33:10 -07:00
Karoy Lorentey
54b265ea5d
[PersistentSet] Don’t check underestimatedCount in is[Strict][Sub,Super]set implementations
...
The input sequence may include duplicate items, which may break these shortcuts.
2022-09-28 18:40:17 -07:00
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
c7906d924e
[PersistentSet] intersect, subtracting, filter: Preserve structure when possible
2022-09-27 23:02:40 -07:00
Karoy Lorentey
03a4791766
[PersistentSet] Add tests for set predicates; fix issues
2022-09-27 14:18:40 -07:00
Karoy Lorentey
a887a77ef5
[PersistentSet] Add tests for intersection & subtracting; fix issues
2022-09-27 14:18:40 -07:00
Karoy Lorentey
6437aea75a
[PersistentCollections] Improve test coverage & fixtures
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
7d6fe857da
[Benchmark] Add Xcode scheme for memory benchmark target
2022-09-27 14:18:39 -07:00
Karoy Lorentey
ac35613ea9
Merge pull request #184 from lorentey/PersistentCollections-updates
...
Persistent collections updates (part 8)
2022-09-26 16:38:04 -07:00
Karoy Lorentey
991f34c045
Merge pull request #185 from lorentey/32bit-BitSet-decoding-fix
...
[BitSet] Fix decoding format on 32 bit architectures
2022-09-25 15:09:53 -07:00
Karoy Lorentey
778b8ae977
[BitSet] Fix decoding an 32-bit architectures
2022-09-25 01:35:44 -07:00
Karoy Lorentey
ba303dca1d
[PersistentDictionary] Add a structural initializer that takes a PersistentSet and a value transform
2022-09-24 17:12:40 -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
826e22c91e
[PersistentDictionary] Implement structural filter & compactMapValues
...
Plus add tests covering these as well and mapValues.
2022-09-24 17:09:36 -07:00
Karoy Lorentey
1c6e5cb30c
[PersistentDictionary] Add CustomReflectable conformance
2022-09-24 17:02:16 -07:00