Karoy Lorentey
4c04822689
[ContainersPreview] Exhibit B in the case against prototyping things in the stdlib 😳
2026-03-26 18:13:22 -07:00
Karoy Lorentey
d2d3b917ca
[BasicContainers, ContainersPreview, DequeModule] More SuppressedAssociatedTypesWithDefaults fixups
2026-03-26 18:12:41 -07:00
Karoy Lorentey
419e2f7df2
[ContainersPreview] Exhibit A in the case against prototyping things in the stdlib 😞
2026-03-26 17:14:45 -07:00
Karoy Lorentey
3e380cb358
[ContainersPreview] Work around compiler crash
2026-03-26 17:14:44 -07:00
Karoy Lorentey
fa80d7c0d3
[ContainersPreview] Work around name lookup anomaly
2026-03-26 16:17:53 -07:00
Karoy Lorentey
a1acf5003b
[ContainersPreview] Make ConsumingMapProducer unconditionally nonescapable
2026-03-26 16:08:49 -07:00
Karoy Lorentey
13c5d9b480
[ContainersPreview] Avoid weird compiler(?) issue(?) with ConsumingFilterProducer’s conditional conformance to Escapable
2026-03-26 16:06:04 -07:00
Karoy Lorentey
eb708a9ba5
[ContainersPreview] Audit some protocol extensions for SuppressedAssociatedTypesWithDefaults
2026-03-26 16:05:07 -07:00
Karoy Lorentey
70a25f1f69
[ContainersPreview] Bump required toolchain to 6.4 for new protocols
2026-03-26 14:51:08 -07:00
Nate Cook
2eac7ce64d
Add tests for BorrowingSequence
...
With just enough algorithms (reduce, elementsEqual) to test.
2026-03-26 14:25:01 -05:00
Nate Cook
a2cf230400
Align BorrowingSequence etc with proposal
...
This updates the ContainersPreview module to use the same
API as the proposed BorrowingSequence protocol and its supporting
types. In particular, instead of using Span as the iterator for
itself and other contiguously-stored types, this introduces
SpanIterator.
2026-03-26 14:25:01 -05:00
Karoy Lorentey
8f88cce7c7
[BasicContainers, ContainersPreview] Make sure package traits “work” on 6.2 toolchains
...
“Work” in this case means that they can be enabled without breaking the build — not necessarily that all features are available.
Swift 6.2 is highly prone to runtime crashes in `swift_getTypeByMangledName` in generic code that uses ownership features. Swift 6.3 will resolve that.
2026-03-17 15:38:34 -07:00
Karoy Lorentey
3dc65340f3
[ContainersPreview] Fix support for Swift 6.2
2026-03-17 13:45:15 -07:00
Karoy Lorentey
2364daa6bf
[ContainersPreview] Update CMake & Xcode build files
2026-03-17 13:32:12 -07:00
Karoy Lorentey
29148932ec
[ContainersPreview] Add a Producer.collect(into:) that takes a RangeReplaceableContainer
...
This is getting into dangerous territory, as RRC allows fixed-capacity conformers, where appending a producer must be done extremely carefully. We should be using bulk append operations, but never ask the container to reserve any more slots than the producer is able to actually generate. (When the fixed-capacity RRC was carefully sized to precisely fit the generator’s contents, asking it to provide space for even a single item more would lead to a runtime trap.)
Additionally, the algorithm should work (and be reasonably efficient) even if the RRC happens to be a dynamically sizing container type.
It would be nice if we had a Producer protocol flavor with an exact count; failing that, we can still do this with a bit of acrobatics, as implemented here. (The `DynamicContainer.append(from:)` algorithm was already implemented this way in a previous commit, with an eye towards this case.)
2026-03-17 13:32:11 -07:00
Karoy Lorentey
2e277a949b
[ContainersPreview] Add a BorrowingIteratorProtocol.copy() algorithm to turn borrowing iterators into producers
2026-03-17 13:32:11 -07:00
Karoy Lorentey
d974987957
[ContainersPreview] DynamicContainer’s Producer-taking init/append methods should consume their input
...
(Because they are running it to completion.)
2026-03-17 13:16:43 -07:00
Karoy Lorentey
7e103afbb6
[ContainersPreview] Oops, fix constraints on conformances of BorrowingMapProducer and BorrowingFilter
2026-03-17 13:15:03 -07:00
Karoy Lorentey
6bbed0e1e2
[ContainersPreview] Conform [Unique,Rigid]Array and [Unique,Rigid]Deque to container protocols
2026-03-17 13:13:42 -07:00
Karoy Lorentey
121462fe19
[ContainersPreview] Add some implementations of .filter
2026-03-16 15:04:30 -07:00
Karoy Lorentey
ea00086c7a
[ContainersPreview] Update CMake/Xcode build configurations
2026-03-13 10:41:06 -07:00
Karoy Lorentey
bf18a48983
[ContainersPreview] Spin off Producer.collect algorithms into a separate file for easy lookups
2026-03-13 10:41:04 -07:00
Karoy Lorentey
c4760ec21a
[ContainersPreview] Flesh out container protocols a little more; add algorithms
...
(This is all untested, unproven code)
2026-03-13 10:30:49 -07:00
Karoy Lorentey
6acfa78c6c
[ContainersPreview] Quick updates to Container
2026-03-13 09:14:30 -07:00
Karoy Lorentey
cde6e86f4f
[ContainersPreview] Underscore elementsEqual for now, to avoid ambiguity with the Sequence method
2026-03-13 09:14:15 -07:00
Karoy Lorentey
41beccbd44
Merge pull request #598 from lorentey/remove-BorrowingSequence.first
...
[ContainersPreview] Remove BorrowingSequence.first
2026-03-09 16:40:18 -07:00
Karoy Lorentey
63030a3530
Merge pull request #599 from lorentey/generateNext-to-next
...
[ContainersPreview] Rename Producer.generateNext() to next()
2026-03-09 16:37:58 -07:00
Karoy Lorentey
3826fe76a8
[ContainersPreview] Rename Producer.generateNext() to next()
...
This better highlights the symmetry between it and the classic method on `IteratorProtocol`, and is also a nice usability win.
2026-03-09 16:22:24 -07:00
Karoy Lorentey
3b10b992bc
[ContainersPreview] Remove BorrowingSequence.first
...
This property is unnecessary; it was just demonstrating an old problem. It clashes with the classic `Collection.first`, and that renders invocations of that ambiguous in code that uses Collection types that also have a BorrowingSequence conformance.
2026-03-09 16:11:56 -07:00
Karoy Lorentey
80878519f2
[doc] Fix most issues reported by docc
...
DocC keeps changing its link syntax. The latest iteration appears to have trouble dealing with `Self`-taking or `Self`-returning methods, so change our API to replace `Self` with a direct mention of the concrete type. ¯\\\_(ツ)\_/¯
That said, the new compiler also found a large number of mismatching parameter names, and that was really helpful.
2026-03-09 14:14:51 -07:00
Karoy Lorentey
1c69635852
Add SPDX-License-Identifier tags
2026-03-05 19:39:24 -08:00
Karoy Lorentey
d9b09ecde8
Update copyright dates
2026-03-05 19:39:20 -08:00
Karoy Lorentey
214d75cb73
BorrowingSequence: estimatedCount ⟹ underestimatedCount
...
EstimatedCount is largely pointless. Knowing the exact count does enable a fast negative path for `elementsEqual`, but we can otherwise make do with just the (much simpler to understand/deal with) `underestimatedCount` that already exists on `Sequence`.
2026-03-05 15:33:27 -08:00
Karoy Lorentey
b7545b990b
[BasicContainers] Add bulk insertions to hashed set types
2026-02-27 13:36:37 -08:00
Karoy Lorentey
4452b1c960
[ContainersPreview] Mark ProducerError as a primary associated type of Producer
2026-02-24 16:41:31 -08:00
Karoy Lorentey
a14f9eb61c
[BasicContainers] Add missing imports of ContainersPreview
2026-02-23 13:56:38 -08:00
Karoy Lorentey
3941dab5b0
[BasicContainers] Implement removals on RigidSet and UniqueSet
...
Dictionaries are still to be done.
2026-02-20 18:19:51 -08:00
Karoy Lorentey
bf9a7033a0
[BasicContainers] Add early drafts for RigidSet/RigidDictionary
2026-02-16 17:15:59 -08:00
Karoy Lorentey
934ad786d2
Merge pull request #570 from lorentey/remove-outputspan-workaround
...
Remove workaround for bug in OutputSpan.wUMBP
2026-02-16 17:14:44 -08:00
Karoy Lorentey
5a4ee8be66
Update docs for Container.nextSpan(after:maximumCount:)
...
Oops, the docs did not explain `maximumCount`.
2026-02-16 15:49:33 -08:00
Karoy Lorentey
8ef702c8a5
Remove workaround for OutputSpan.wUMBP bug
2026-02-05 17:07:03 -08:00
Karoy Lorentey
6c1d4ab9c8
Update Xcode and CMake build configurations
2026-02-04 23:24:11 -08:00
Karoy Lorentey
e4a874b67a
Rigid & Unique types: Add Equatable, Hashable, Custom[Debug]StringConvertible operations
...
Currently these are all conditional on copyable elements, and the types cannot conform to the actual protocols yet.
2026-02-04 23:24:08 -08:00
Karoy Lorentey
7692d9c4b3
RigidArray: Add test coverage; revive some container-based operations
2026-02-04 22:41:33 -08:00
Karoy Lorentey
0b8e5971d8
Another spot where we call the stdlib’s OutputSpan.wUMBP
2026-02-04 17:47:50 -08:00
Karoy Lorentey
9503f8fe57
Improve consistency of precondition failure messages
...
More uniform message strings should feel better, and they should ever so slightly reduce code size.
2026-02-04 10:27:17 -08:00
Karoy Lorentey
030f751515
[BasicContainers] RigidArray, UniqueArray: Fill out missing indexing APIs
2026-02-03 14:06:03 -08:00
Karoy Lorentey
772c426bc9
Oh this is proving a bit more difficult than ideal
2026-01-29 15:02:53 -08:00
Karoy Lorentey
801d361bbb
Reinstate OutputSpan additions accidentally removed during merge
2026-01-29 14:39:07 -08:00
Karoy Lorentey
70dd9cd5d9
Merge branch 'main' into all-hands-on-deque
...
# Conflicts:
# Sources/BasicContainers/RigidArray+Insertions.swift
# Sources/ContainersPreview/OutputSpan+Extras.swift
2026-01-29 14:29:47 -08:00