Karoy Lorentey
86bce28835
[docs] Start working on DocC support
2022-10-28 12:34:14 -07:00
Karoy Lorentey
2dae70dba7
[OrderedSet, BitSet] Fix display style of custom mirror
2022-10-27 18:29:32 -07:00
Karoy Lorentey
e3cc498060
[BitSet.Counted] Review, test, fix, and document binary set operations & predicates
2022-10-21 19:49:14 -07:00
Karoy Lorentey
1355d478af
[BitSet] Review, test, extend, and document binary set operations
2022-10-21 19:49:07 -07:00
Karoy Lorentey
9cd030f21e
[BitSet] Add missing Custom[Debug]StringConvertable conformances, review existing ones
...
Add `Custom[Debug]StringConvertible` conformance on `BitSet.Index`.
2022-10-20 17:14:52 -07:00
Karoy Lorentey
3c6cb8cd56
Update CMake configuration
2022-10-19 17:35:13 -07:00
Karoy Lorentey
001df8e325
[BitSet] Review, test, fix, and document set relation predicates
...
- Update documentation
- Improve performance where possible
- Add missing test coverage where needed
2022-10-19 15:20:17 -07:00
Karoy Lorentey
291623d391
[BitSet] Implement isEqual(to:) family of functions
2022-10-19 01:40:06 -07:00
Karoy Lorentey
86d429604c
[BitSet] Doc updates
2022-10-19 01:40:06 -07:00
Karoy Lorentey
51a1554f89
Introduce _UniqueCollection & _SortedCollection
...
These marker-like protocols will allow certain
generic operations to get a performance boost
if the passed-in value happens to be guaranteed
to contain unique elements or to be sorted.
Also, review API checker protocols for Sets and
sorted collections and adjust things as needed.
BitSet gains custom implementations for min()
and max() as part of these improvements.
2022-10-19 01:40:06 -07:00
Karoy Lorentey
f76630db8e
[Internals] Add missing internal checking predicates & docs for all
2022-10-18 22:13:19 -07:00
Karoy Lorentey
5aed92655d
[CMake] Update CMake build configuration
2022-10-11 13:11:37 -07:00
Karoy Lorentey
6286cd0b99
Restore support for building with Swift 5.5
...
This is mostly about adding more type declarations to deal with type checker limitations in the older compiler.
This also includes workarounds that allow better support for CodingKeyRepresentable in PersistentDictionary, and it fixes a couple of small oversights on various #else branches.
2022-10-10 18:07:49 -07:00
Karoy Lorentey
541bd53958
[BitCollections] Move shared utilities to _CollectionsUtilities
2022-10-09 20:11:51 -07:00
Karoy Lorentey
1b71d2cd94
[BitSet] Fix invariant violation in member subscript
2022-10-09 16:12:17 -07:00
Karoy Lorentey
78ac2eaed7
[BitSet] Add remove(at:) implementation
2022-10-09 13:20:12 -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
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
ac35613ea9
Merge pull request #184 from lorentey/PersistentCollections-updates
...
Persistent collections updates (part 8)
2022-09-26 16:38:04 -07:00
Karoy Lorentey
778b8ae977
[BitSet] Fix decoding an 32-bit architectures
2022-09-25 01:35:44 -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
59858a7721
[BitSet.Counted] Fix invariant checking (d’oh)
2022-09-23 11:15:37 -07:00
Károly Lőrentey
41fe772f88
[BitSet] More doc fixes 🤦🏼♂️
2022-09-04 19:27:51 -07:00
Károly Lőrentey
141ef3c706
[BitArray] Use a platform-independent Codable encoding
2022-09-04 19:26:46 -07:00
Károly Lőrentey
a137a71c6f
[BitSet] Use a platform-independent Codable encoding
2022-09-04 19:26:34 -07:00
Karoy Lorentey
793d326976
[BitSet.Counted] Force-inline _modify accessors
2022-08-31 15:34:08 -07:00
Karoy Lorentey
4dfcc4f9ef
[BitSet] Doc fixes
2022-08-31 13:14:45 -07:00
Karoy Lorentey
464d973bf3
[BitSet] Remove precalculated count. Add BitSet.Counted wrapper for use cases that require it.
...
This results in a significant speedup for both individual
insert/remove operations as well as bulk set operations -
up to 4x.
Use cases that require an O(1) count can use the separate
BitSet.Counted type.
2022-08-31 13:04:51 -07:00
Karoy Lorentey
1c9c9fc664
[BitSet] Validate index passed to subscript in debug builds
2022-08-31 11:37:04 -07:00
Karoy Lorentey
e34bbb8c4c
[BitSet] Add reserveCapacity.
...
This works slightly different as usual, as the input argument
specifies the maximum value we expect to store, not the maximum
count.
2022-08-29 22:40:59 -07:00
Karoy Lorentey
d6e585f84e
[BitSet] Add index validation assertions
...
Only asserts, not preconditions, as passing invalid indices here
cannot lead to out-of-bounds access — we have unconditional
bounds checks later.
2022-08-29 22:40:03 -07:00
Karoy Lorentey
5fe91efeba
[BitArray] Add Codable conformance
2022-08-28 17:32:46 -07:00
Karoy Lorentey
72497fe212
[BitSet] Add Codable conformance
2022-08-28 17:32:33 -07:00
Karoy Lorentey
c02557f717
[BitSet] Add member subscripts
2022-08-28 16:33:50 -07:00
Karoy Lorentey
b5511d3711
[BitSet] Add custom implementation for filter
2022-08-26 14:21:37 -07:00
Karoy Lorentey
b9ea3f0dd3
[BitSet] Add Custom[Debug]StringConvertible, CustomReflectable conformances
2022-08-26 14:21:15 -07:00
Karoy Lorentey
bae950193f
[BitArray] Add Custom[Debug]StringConvertible and CustomReflectable conformances
2022-08-26 14:19:56 -07:00
Karoy Lorentey
1217b3289a
[BitSet] Fix index offsetting
2022-08-26 01:04:18 -07:00
Karoy Lorentey
54d47c1e23
[BitSet] Add docs.
2022-08-26 00:09:13 -07:00
Karoy Lorentey
5bc22eaf9b
[BitArray] Add docs.
2022-08-25 23:50:35 -07:00
Karoy Lorentey
fcac09d86a
[BitSet, BitArray] Add random factories
2022-08-25 22:21:34 -07:00
Karoy Lorentey
65976b8d85
[BitSet] Add some docs.
2022-08-25 20:26:48 -07:00
Karoy Lorentey
544507ee62
[BitArray] Add some docs.
2022-08-25 20:26:48 -07:00
Karoy Lorentey
1aed39e0c6
[BitSet] Implement fancy index methods
2022-08-25 20:26:48 -07:00
Karoy Lorentey
3642c26f58
[BitSet] Use standard temporary allocation facility when available
2022-08-17 13:49:07 -07:00
Karoy Lorentey
d8d9c5ea25
[BitSet] Add documentation
2022-08-16 19:01:11 -07:00
Karoy Lorentey
da84296b9b
[BitSet] Add custom sorted(), returning self
2022-08-16 15:53:06 -07:00
Karoy Lorentey
4cb8ecebee
[BitSet] Add new initializers (from words & bit arrays)
2022-08-16 15:44:13 -07:00
Karoy Lorentey
94e2e477db
[BitArray] Add truncateOrExtend method
...
This comes handy to e.g. restore the original count of a bit array
after a BitArray→BitSet→BitArray conversion roundtrip.
2022-08-16 15:43:34 -07:00