Skip to content

Commit 7b847a3

Browse files
authored
Merge pull request #525 from apple/interim-1.3-branch
One last round of documentation updates
2 parents bf71f06 + ccb6059 commit 7b847a3

File tree

5 files changed

+34
-34
lines changed

5 files changed

+34
-34
lines changed

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ Read more about the package, and the intent behind it, in the [announcement on s
1010

1111
The package currently provides the following implementations:
1212

13-
- [`UniqueArray`][UniqueArray], a dynamically self-resizing, heap allocated, noncopyable array of potentially noncopyable elements.
14-
15-
- [`RigidArray`][RigidArray], a fixed capacity, heap allocated, noncopyable array of potentially noncopyable elements.
16-
1713
- [`BitSet`][BitSet] and [`BitArray`][BitArray], dynamic bit collections.
1814

1915
- [`Deque<Element>`][Deque], a double-ended queue backed by a ring buffer. Deques are range-replaceable, mutable, random-access collections.
@@ -26,8 +22,10 @@ The package currently provides the following implementations:
2622

2723
- [`TreeSet`][TreeSet] and [`TreeDictionary`][TreeDictionary], persistent hashed collections implementing Compressed Hash-Array Mapped Prefix Trees (CHAMP). These work similar to the standard `Set` and `Dictionary`, but they excel at use cases that mutate shared copies, offering dramatic memory savings and radical time improvements.
2824

29-
[RigidArray]: https://swiftpackageindex.com/apple/swift-collections/documentation/basiccontainers/rigidarray
30-
[UniqueArray]: https://swiftpackageindex.com/apple/swift-collections/documentation/basiccontainers/uniquearray
25+
- [`UniqueArray`][UniqueArray] and [`RigidArray`][RigidArray], noncopyable array variants trading some of `Array`'s flexibility for more predictable performance.
26+
27+
- [`TrailingArray`][TrailingArray], a low-level, ownership-aware variant of `ManagedBuffer`, for interoperability with C constructs that consist of a fixed-size header directly followed by variable-size storage buffer.
28+
3129
[BitSet]: https://swiftpackageindex.com/apple/swift-collections/documentation/bitcollections/bitset
3230
[BitArray]: https://swiftpackageindex.com/apple/swift-collections/documentation/bitcollections/bitarray
3331
[Deque]: https://swiftpackageindex.com/apple/swift-collections/documentation/dequemodule/deque
@@ -36,8 +34,11 @@ The package currently provides the following implementations:
3634
[OrderedDictionary]: https://swiftpackageindex.com/apple/swift-collections/documentation/orderedcollections/ordereddictionary
3735
[TreeSet]: https://swiftpackageindex.com/apple/swift-collections/documentation/hashtreecollections/treeset
3836
[TreeDictionary]: https://swiftpackageindex.com/apple/swift-collections/documentation/hashtreecollections/treedictionary
37+
[RigidArray]: https://swiftpackageindex.com/apple/swift-collections/documentation/basiccontainers/rigidarray
38+
[UniqueArray]: https://swiftpackageindex.com/apple/swift-collections/documentation/basiccontainers/uniquearray
39+
[TrailingArray]: https://swiftpackageindex.com/apple/swift-collections/documentation/trailingelementsmodule/trailingarray
3940

40-
Swift Collections uses the same modularization approach as [**Swift Numerics**](https://github.com/apple/swift-numerics): it provides a standalone module for each thematic group of data structures it implements. For instance, if you only need a double-ended queue type, you can pull in only that by importing `DequeModule`. `OrderedSet` and `OrderedDictionary` share much of the same underlying implementation, so they are provided by a single module, called `OrderedCollections`. However, there is also a top-level `Collections` module that gives you every collection type with a single import statement:
41+
Swift Collections uses the same modularization approach as [**Swift Numerics**](https://github.com/apple/swift-numerics): it provides a standalone module for each thematic group of data structures it implements. For instance, if you only need a double-ended queue type, you can pull in only that by importing `DequeModule`. `OrderedSet` and `OrderedDictionary` share much of the same underlying implementation, so they are provided by a single module, called `OrderedCollections`. However, there is also a top-level `Collections` module that gives you the most commonly used collection types with a single import statement:
4142

4243
``` swift
4344
import Collections
@@ -95,7 +96,7 @@ The following table maps package releases to their minimum required Swift toolch
9596
To use this package in a SwiftPM project, you need to set it up as a package dependency:
9697

9798
```swift
98-
// swift-tools-version:6.1
99+
// swift-tools-version:6.2
99100
import PackageDescription
100101

101102
let package = Package(
@@ -132,14 +133,14 @@ We maintain separate branches for each minor version of the package:
132133
| Package version | Branch | Status |
133134
| ----------------------- | ----------- | -------- |
134135
| swift-collections 1.0.x | release/1.0 | Obsolete |
135-
| swift-collections 1.1.x | release/1.1 | Critical bugfixes only |
136-
| swift-collections 1.2.x | release/1.2 | Critical bugfixes only |
136+
| swift-collections 1.1.x | release/1.1 | Obsolete |
137+
| swift-collections 1.2.x | release/1.2 | Bugfixes only |
137138
| swift-collections 1.3.x | release/1.3 | Bugfixes only |
138139
| n.a. | main | Feature work towards next minor release |
139140

140141
Changes must land on the branch corresponding to the earliest release that they will need to ship on. They are periodically propagated to subsequent branches, in the following direction:
141142

142-
`release/1.0``release/1.1``release/1.2``release/1.3``main`
143+
`release/1.1``release/1.2``release/1.3``main`
143144

144145
For example, anything landing on `release/1.2` will eventually appear on `release/1.3` and then `main` too; there is no need to file standalone PRs for each release line. Change propagation is not instantaneous, as it currently requires manual work -- it is performed by project maintainers.
145146

Sources/BasicContainers/BasicContainers.docc/BasicContainers.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This currently consists of two noncopyable variants of the standard `Array` type
88

99
Unlike `Array`, these new types do not support copy-on-write value semantics -- indeed, they aren't (implicitly) copyable at all, even if their element type happens to be copyable.
1010

11-
### `struct UniqueArray`
11+
### struct UniqueArray
1212

1313
``UniqueArray`` is a dynamically self-resizing array type that automatically grows its storage as needed to accommodate inserted items. Its name highlights that unlike `Array`, instances of this type are always uniquely owned, never shared. Mutations of a `UniqueArray` therefore never need to copy their storage.
1414

@@ -41,7 +41,7 @@ Note how preserving a copy of the array at the start of the loop forces the subs
4141

4242
Taking away the freedom to make implicit copies forces you to think a lot more about ownership concerns when using this type -- it can feel a lot more constrained and nitpicky. In exchange though, it gets much easier to reason about the runtime performance of your code; the subscript mutation looks the same as before, but now it is guaranteed to _always_ have constant complexity.
4343

44-
### `struct RigidArray`
44+
### struct RigidArray
4545

4646
``RigidArray`` goes a step even further than ``UniqueArray`` by also disabling automatic storage reallocations: it is a fixed-capacity array type. Rigid array instances get created with a specific capacity, and they never resize themselves. If they run out of room, they report a runtime error!
4747

@@ -62,7 +62,7 @@ This allows ``RigidArray`` to still provide _explicit_ resizing operations: it h
6262

6363
## Topics
6464

65-
### Structures
65+
### Types
6666

6767
- ``UniqueArray``
6868
- ``RigidArray``

Sources/BasicContainers/BasicContainers.docc/Extensions/RigidArray.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979

8080
- ``replaceSubrange(_:newCount:initializingWith:)``
8181
- ``replaceSubrange(_:moving:)-(_,OutputSpan<Element>)``
82-
- ``replaceSubrange(_:moving:)-(_,RigidArray<Element>))``
82+
- ``replaceSubrange(_:moving:)-(_,RigidArray<Element>)``
8383
- ``replaceSubrange(_:moving:)-(_,UnsafeMutableBufferPointer<Element>)``
8484
- ``replaceSubrange(_:consuming:)``
8585
- ``replaceSubrange(_:copying:)-(_,Collection<Element>)``

Sources/BasicContainers/BasicContainers.docc/Extensions/UniqueArray.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Topics
44

5-
### Creating a rigid array
5+
### Creating a Unique Array
66

77
- ``init()``
88
- ``init(capacity:)``
@@ -12,7 +12,7 @@
1212
- ``init(capacity:copying:)-(_,Sequence<Element>)``
1313
- ``init(capacity:copying:)-(_,Collection<Element>)``
1414

15-
### Inspecting a rigid array
15+
### Inspecting a Unique Array
1616

1717
- ``isEmpty``
1818
- ``isFull``
@@ -27,13 +27,13 @@
2727
- ``endIndex``
2828
- ``indices``
2929

30-
### Accessing elements
30+
### Accessing Elements
3131

3232
- ``subscript(position:)``
3333
- ``swapAt(_:_:)``
3434
- ``edit(_:)``
3535

36-
### Memory management
36+
### Memory Management
3737

3838
- ``reallocate(capacity:)``
3939
- ``reserveCapacity(_:)``
@@ -49,7 +49,7 @@
4949
- ``mutableSpan(after:)``
5050
- ``mutableSpan(before:)``
5151

52-
### Appending items
52+
### Appending Items
5353

5454
- ``append(_:)``
5555
- ``pushLast(_:)``
@@ -62,7 +62,7 @@
6262
- ``append(copying:)-(UnsafeBufferPointer<Element>)``
6363
- ``append(copying:)-(UnsafeMutableBufferPointer<Element>)``
6464

65-
### Inserting items
65+
### Inserting Items
6666

6767
- ``insert(_:at:)``
6868
- ``insert(count:at:initializingWith:)``
@@ -75,19 +75,19 @@
7575
- ``insert(copying:at:)-(UnsafeBufferPointer<Element>,_)``
7676
- ``insert(copying:at:)-(UnsafeMutableBufferPointer<Element>,_)``
7777

78-
### Replacing items
78+
### Replacing Items
7979

8080
- ``replaceSubrange(_:newCount:initializingWith:)``
8181
- ``replaceSubrange(_:moving:)-(_,OutputSpan<Element>)``
82-
- ``replaceSubrange(_:moving:)-(_,RigidArray<Element>))``
82+
- ``replaceSubrange(_:moving:)-(_,RigidArray<Element>)``
8383
- ``replaceSubrange(_:moving:)-(_,UnsafeMutableBufferPointer<Element>)``
8484
- ``replaceSubrange(_:consuming:)``
8585
- ``replaceSubrange(_:copying:)-(_,Collection<Element>)``
8686
- ``replaceSubrange(_:copying:)-(_,Span<Element>)``
8787
- ``replaceSubrange(_:copying:)-(_,UnsafeBufferPointer<Element>)``
8888
- ``replaceSubrange(_:copying:)-(_,UnsafeMutableBufferPointer<Element>)``
8989

90-
### Removing items
90+
### Removing Items
9191

9292
- ``removeAll()``
9393
- ``removeLast()``

Sources/Collections/Collections.docc/Collections.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,17 @@
44

55
## Overview
66

7+
### Modules
78

9+
- [**Basic Containers**](./basiccontainers) - Defines [`UniqueArray`][UniqueArray] and [`RigidArray`][RigidArray], noncopyable array variants trading some of `Array`'s flexibility for more predictable performance.
10+
- [**Bit Collections**](./bitcollections) - Defines [`BitSet`](./bitcollections/bitset) and [`BitArray`](./bitcollections/bitarray), dynamic bit collections.
11+
- [**Deque Module**](./dequemodule) - Defines [`Deque<Element>`](./dequemodule/deque), a double-ended queue backed by a ring buffer. Deques are range-replaceable, mutable, random-access collections.
12+
- [**Heap Module**](./heapmodule) - Defines [`Heap`](./heapmodule/heap), a min-max heap backed by an array, suitable for use as a priority queue.
13+
- [**Ordered Collections**](./orderedcollections) - Defines [`OrderedSet<Element>`](./orderedcollections/orderedset), a variant of the standard `Set` where the order of items is well-defined and items can be arbitrarily reordered. Uses a `ContiguousArray` as its backing store, augmented by a separate hash table of bit packed offsets into it. [`OrderedDictionary<Key, Value>`](./orderedcollections/ordereddictionary), an ordered variant of the standard `Dictionary`, providing similar benefits.
14+
- [**Hash Tree Collections**](./hashtreecollections) - Defines [`TreeSet`](./hashtreecollections/treeset) and [`TreeDictionary`](./hashtreecollections/treedictionary), persistent hashed collections implementing Compressed Hash-Array Mapped Prefix Trees (CHAMP). These work similar to the standard `Set` and `Dictionary`, but they excel at use cases that mutate shared copies, offering dramatic memory savings and radical time improvements.
15+
- [**Trailing Elements Module**](./trailingelementsmodule) - Defines [`TrailingArray`](./trailingarray), a low-level, ownership-aware variant of `ManagedBuffer`, for interoperability with C constructs that consist of a fixed-size header directly followed by variable-size storage buffer.
816

9-
#### Additional Resources
17+
### Additional Resources
1018

1119
- [`Swift Collections` on GitHub](https://github.com/apple/swift-collections/)
1220
- [`Swift Collections` on the Swift Forums](https://forums.swift.org/c/related-projects/collections/72)
13-
14-
### Modules
15-
16-
- [Basic Containers](./basiccontainers) - [`RigidArray`](./basiccontainers/rigidarray), a fixed capacity and no implicit resizing dynamic non-copyable array capable of storing non-copyable elements. [`UniqueArray`](./basiccontainers/uniquearray), an implicitly resizable dynamic non-copyable array capable of storing non-copyable elements.
17-
- [Bit Collections](./bitcollections) - [`BitSet`](./bitcollections/bitset) and [`BitArray`](./bitcollections/bitarray), dynamic bit collections.
18-
- [Deque Module](./dequemodule) - [`Deque<Element>`](./dequemodule/deque), a double-ended queue backed by a ring buffer. Deques are range-replaceable, mutable, random-access collections.
19-
- [Heap Module](./heapmodule) - [`Heap`](./heapmodule/heap), a min-max heap backed by an array, suitable for use as a priority queue.
20-
- [Ordered Collections](./orderedcollections) - [`OrderedSet<Element>`](./orderedcollections/orderedset), a variant of the standard `Set` where the order of items is well-defined and items can be arbitrarily reordered. Uses a `ContiguousArray` as its backing store, augmented by a separate hash table of bit packed offsets into it. [`OrderedDictionary<Key, Value>`](./orderedcollections/ordereddictionary), an ordered variant of the standard `Dictionary`, providing similar benefits.
21-
- [Hash Tree Collections](./hashtreecollections) - [`TreeSet`](./hashtreecollections/treeset) and [`TreeDictionary`](./hashtreecollections/treedictionary), persistent hashed collections implementing Compressed Hash-Array Mapped Prefix Trees (CHAMP). These work similar to the standard `Set` and `Dictionary`, but they excel at use cases that mutate shared copies, offering dramatic memory savings and radical time improvements.

0 commit comments

Comments
 (0)