Commit Graph
80 Commits
Author SHA1 Message Date
Karoy Lorentey 35d5746117 Rename _CollectionsUtilities to InternalCollectionsUtilities
We are forced to do this due to an Xcode issue (#364) with underscored module names.

This module remains unstable, despite the removal of the underscore. Directly importing it from outside the package remains unsupported. This module and/or its entire contents may go away or change in incompatible ways in any future swift-collections release.
2024-05-29 14:00:13 -07:00
Dimitris Apostolou 7539583245 Fix typos
# Conflicts:
#	Sources/SortedCollections/BTree/_BTree+BidirectionalCollection.swift
#	Sources/SortedCollections/BTree/_BTree+UnsafeCursor.swift
#	Sources/SortedCollections/BTree/_BTree.Builder.swift
#	Sources/SortedCollections/BTree/_BTree.swift
#	Sources/SortedCollections/BTree/_Node.Splinter.swift
#	Sources/SortedCollections/BTree/_Node.Storage.swift
#	Sources/SortedCollections/BTree/_Node.UnsafeHandle+Insertion.swift
#	Sources/SortedCollections/BTree/_Node.swift
#	Tests/SortedCollectionsTests/BTree/Node+Join Tests.swift
2024-02-06 15:52:26 -08:00
Karoy Lorentey 64b286d63d [OrderedCollections] Update copyright notices 2024-02-02 16:20:21 -08:00
Karoy Lorentey f59aeeb56a [OrderedCollections] Adopt modern generic declaration syntax and _specialize 2024-02-02 16:20:21 -08:00
Karoy Lorentey 1a0ac8c06c Merge branch 'release/1.0' into release/1.1
# Conflicts:
#	Sources/DequeModule/CMakeLists.txt
#	Sources/DequeModule/Deque+Collection.swift
#	Sources/DequeModule/Deque+Sendable.swift
#	Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.SubSequence.swift
#	Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Elements.swift
#	Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Sendable.swift
#	Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Sequence.swift
#	Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Values.swift
#	Sources/OrderedCollections/OrderedSet/OrderedSet+Sendable.swift
#	Sources/OrderedCollections/OrderedSet/OrderedSet+SubSequence.swift
#	Sources/OrderedCollections/OrderedSet/OrderedSet+UnorderedView.swift
#	Sources/OrderedCollections/OrderedSet/OrderedSet+UnstableInternals.swift
2023-12-21 15:17:15 -08:00
Karoy Lorentey 9d4a1e5ad2 [OrderedSet] Don’t try to conform to Sendable below Swift 5.5 2023-12-19 17:10:37 -08:00
Karoy Lorentey 8bfcaddd5f [1.0] Update copyright dates 2023-12-18 15:35:56 -08:00
Karoy Lorentey 7d43c07a71 Backport Sendable conformances on all public types
Resolves #317
2023-12-18 15:25:38 -08:00
Rick van Voorden e37e505da5 ordered set fix compiler error 2023-12-12 12:33:38 -08:00
Rick van VoordenandKaroy Lorentey 9430147598 ordered set bounds equality check
Co-authored-by: Karoy Lorentey <klorentey@apple.com>
2023-12-12 12:27:48 -08:00
Rick van Voorden e2b033c8ea forward ordered set subsequence equality to elements property 2023-12-11 15:24:07 -08:00
Rick van Voorden 3caf13b4f8 forward ordered set equality to elements property 2023-12-08 20:32:31 -08:00
Karoy Lorentey 33e2e610f5 Merge branch 'release/1.0' into release/1.1
# Conflicts:
#	Tests/_CollectionsTestSupport/MinimalTypes/MinimalDecoder.swift
2023-11-14 18:06:24 -08:00
kati-kms b72a6cfd93 Fix typos: OrderedSet.swift DocC 2023-11-10 15:38:16 +09:00
Karoy Lorentey 09c09f0f73 Fix CustomStringConvertible/CustomDebugStringConvertible conformances
- For CustomStringConvertible, `description` should print elements using `String(reflecting:)` rather than `String(describing:)`, to avoid element output from interfering with syntactically relevant punctuation within structured list displays.
- To make this work without making displays overly verbose, make `debugDescription` mostly the same as `description`, except for escaping raw string displays when and if needed.
- Avoid printing type names in `debugDescription` — it is generally not helpful, as the type is already easily accessible elsewhere. Including it makes for overly verbose displays when the type serves as an Element of a collection.
- Avoid having `debugDescription` return the empty string — it can be confusing when such a description appears in list displays.

Resolves #301.
2023-07-06 17:25:11 -07:00
Karoy Lorentey 3e4a8b4dff Merge branch 'release/1.0' into release/1.1
# Conflicts:
#	.gitignore
#	Package.swift
#	Sources/Collections/Collections.docc/Collections.md
#	Sources/Collections/Collections.docc/Extensions/Deque.md
#	Sources/Collections/Collections.docc/Extensions/OrderedSet.UnorderedView.md
#	Sources/Collections/Collections.docc/Extensions/OrderedSet.md
#	Sources/DequeModule/DequeModule.docc/DequeModule.md
#	Sources/DequeModule/DequeModule.docc/Extensions/Deque.md
#	Sources/OrderedCollections/HashTable/_HashTable+UnsafeHandle.swift
#	Sources/OrderedCollections/OrderedCollections.docc/Extensions/OrderedSet.UnorderedView.md
#	Sources/OrderedCollections/OrderedCollections.docc/Extensions/OrderedSet.md
#	Sources/OrderedCollections/OrderedCollections.docc/OrderedCollections.md
#	Sources/OrderedCollections/OrderedDictionary/OrderedDictionary.swift
#	Sources/OrderedCollections/OrderedSet/OrderedSet.swift
#	Sources/OrderedCollections/Utilities/_UnsafeBitset.swift
#	Utils/generate-docs.sh
2023-04-24 13:45:55 -07:00
Karoy Lorentey a8dad62bc9 Remove obsolete swift(>=5.5)/swift(>=5.6) checks 2023-04-10 18:33:52 -07:00
Karoy Lorentey cbab9e3737 Introduce COLLECTIONS_SINGLE_MODULE condition 2023-03-21 18:42:33 -07:00
Karoy Lorentey a874de5f7f [OrderedCollections] Refresh some docs with DocC links 2022-12-06 19:00:59 -08:00
Karoy Lorentey 08b38129b9 [OrderedSet] Fix outdated documentation 2022-12-06 18:41:29 -08:00
Karoy Lorentey 69768b6eac [OrderedCollections, BitCollections] Fix more warnings in development versions of Swift 2022-11-28 21:53:06 -08:00
Karoy Lorentey a2f4b18ae0 [BitSet, OrderedCollections] Unify UnsafeBitSet implementations 2022-11-28 16:30:55 -08:00
Karoy Lorentey 8f7d5fd505 [SetAlgebra types] isEqual(to:) → isEqualSet(to:)
The `isEqual(to:)` methods are a bit too confusing — they implement
mathematical set comparisons (ignoring element ordering and, in the
case of the Sequence variant, even element multiplicities), so it
seems better to highlight this by putting a `Set` in the name.
2022-10-31 15:05:12 -07:00
Karoy Lorentey aaeeb9e440 [OrderedCollections] Doc updates 2022-10-28 12:34:14 -07:00
Karoy Lorentey de22bed429 [OrderedCollections] Update top-level docs 2022-10-28 12:34:14 -07:00
Karoy Lorentey a9fd8af830 Merge pull request #225 from lorentey/fix-custom-mirrors
[OrderedSet, BitSet] Fix custom mirror display style
2022-10-28 12:20:49 -07:00
Karoy Lorentey 207029a613 [OrderedSet] Improve Sequence initializer 2022-10-27 18:32:06 -07:00
Karoy Lorentey 2dae70dba7 [OrderedSet, BitSet] Fix display style of custom mirror 2022-10-27 18:29:32 -07:00
Karoy Lorentey 0914e6f546 [OrderedSet] More test coverage for set operations; clarify docs 2022-10-21 18:24:08 -07:00
Karoy Lorentey 3a07b859e0 [OrderedSet] Split SetAlgebra binary operations into individual files 2022-10-21 18:24:08 -07:00
Karoy Lorentey 7143421800 [OrderedCollections] Add missing Custom[Debug]StringConvertable conformances, review existing ones
Add `Custom[Debug]StringConvertible` conformance on:

- `OrderedDictionary.Values`
- `OrderedDictionary.Elements.Subsequence`
- `OrderedSet.SubSequence`
2022-10-20 17:14:52 -07:00
Karoy Lorentey 381cf5d17e Merge branch 'release/1.0' into release/1.1 2022-10-19 15:50:34 -07:00
Karoy Lorentey 734730d724 [OrderedSet] Split SetAlgebra predicates into individual files
This is to match the layout of all the other
SetAlgebra implementations in this package.
2022-10-19 15:20:30 -07:00
Karoy Lorentey 5dfd51238c [OrderedSet] Review, test, fix, and document set relation predicates 2022-10-19 15:20:30 -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 2b4ec22949 [OrderedSet] Small doc updates/fixes 2022-10-18 22:03:29 -07:00
Karoy Lorentey 51604cd196 [OrderedCollections] Oops, restore custom wording for areInIncreasingOrder variants 2022-10-12 15:11:57 -07:00
Karoy Lorentey a624614717 [OrderedCollections] Document that sort is stable (as of SE-0372) 2022-10-11 13:38:10 -07:00
Karoy Lorentey 8b06c61c7e Merge branch 'release/1.0' into release/1.1 2022-10-11 11:24:28 -07:00
Karoy Lorentey 3d11356006 [OrderedSet] Move RAC utilities to _CollectionsUtilities module 2022-10-09 20:11:51 -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 66651795d8 [OrderedSet] Tiny doc fixes for isSuperset. 2022-09-29 17:56:55 -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 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 12e3867ccb [Collections] Allow determining if internal checking is enabled
In the benchmark target, complain loudly if consistency checks
are enabled.
2022-09-19 21:25:07 -07:00
Karoy Lorentey 77edbef16d [_CollectionsUtilities] Restore original debug descriptions 2022-09-13 23:45:22 -07:00
Karoy Lorentey dd76591970 [_CollectionsUtilities] New module. Use it to unify description/debugDescription implementations 2022-09-12 12:47:04 -07:00
Karoy Lorentey b379fa7aee [OrderedCollections] Force-inline all _modify accessors
(cherry picked from commit ee1b2de06e)
2022-08-31 17:13:53 -07:00
Karoy Lorentey 6cbecdb467 [OrderedSet] Work around weird name lookup issue in compiler
Resolves #157.

(cherry picked from commit 1071b37294)
2022-08-31 17:13:53 -07:00