Skip to content

Update dependency apple/swift-collections to from: "1.4.1"#237

Merged
renovate[bot] merged 1 commit into
mainfrom
renovate/apple-swift-collections-1.x
Mar 19, 2026
Merged

Update dependency apple/swift-collections to from: "1.4.1"#237
renovate[bot] merged 1 commit into
mainfrom
renovate/apple-swift-collections-1.x

Conversation

@renovate
Copy link
Copy Markdown
Contributor

@renovate renovate Bot commented Mar 19, 2026

This PR contains the following updates:

Package Update Change
apple/swift-collections patch from: "1.4.0"from: "1.4.1"

Release Notes

apple/swift-collections (apple/swift-collections)

v1.4.1: Swift Collections 1.4.1

Compare Source

This patch release is mostly focusing on evolving the package traits UnstableContainersPreview and UnstableHashedContainers, with the following notable fixes and improvements to the stable parts of the package:

  • Make the package documentation build successfully on the DocC that ships in Swift 6.2.
  • Avoid using floating point arithmetic to size collection storage in the DequeModule and OrderedCollections modules.

Changes to experimental package traits

The new set and dictionary types enabled by the UnstableHashedContainers trait have now resolved several correctness issues in their implementation of insertions. They have also gained some low-hanging performance optimizations. Like before, these types are in "working prototype" phase, and while they have working implementations of basic primitive operations, we haven't done much work validating their performance yet. Feedback from intrepid early adopters would be very welcome.

The UnstableContainersPreview trait has gained several new protocols and algorithm implementations, working towards one possible working model of a coherent, ownership-aware container/iteration model.

  • BidirectionalContainer defines a container that allows iterating over spans backwards, and provides decrement operations on indices -- an analogue of the classic BidirectionalCollection protocol.

  • MutableContainer is the ownership-aware analogue of MutableCollection -- it models a container type that allows its elements to be arbitrarily reordered and mutated/reassigned without changing the shape of the data structure (that is to say, without invalidating any indices).

  • PermutableContainer is an experimental new spinoff of MutableContainer, focusing on reordering items without allowing arbitrary mutations.

  • RangeReplaceableContainer is a partial, ownership-aware analogue of RangeReplaceableCollection, providing a full set of insertion/append/removal/consumption operations, with support for fixed-capacity conforming types.

  • DynamicContainer rounds out the range-replacement operations with initializer and capacity reservation requirements that can only be implemented by dynamically sized containers.

  • We now have working reference implementations of lazy map, reduce and filter operations on borrowing iterators, producers and drains, as well a collect(into:) family of methods to supply "greedy" variants, generating items into a container of the user's choice. Importantly, the algorithms tend to be defined on the iterator types, rather than directly on some sequence/container -- going this way has some interesting benefits (explicitness, no confusion between the various flavors or the existing Sequence algorithms), but they also have notable drawbacks (minor design issues with the borrowing iterator protocol, unknowns on how the pattern would apply to container algorithms, etc.).

    let items: RigidArray<Int> = ...
    let transformed = 
      items.makeBorrowingIterator() // obviously we'd want a better name here, like `borrow()`
      .map { 2 * $0 }
      .collect(into: UniqueArray.self)
    // `transformed` is a UniqueArray instance holding all values in `items`, doubled up 
    let items: RigidArray = ...
    let transformed = 
       items.makeBorrowingIterator()
      .filter { !$0.isMultiple(of: 7) }
      .copy()
      .collect(into: UniqueArray.self)
    // `transformed` holds a copy of all values in `items` that aren't a multiple of 7
    let items: RigidArray = ...
    let transformed = 
       items.consumeAll()
      .filter { !$0.isMultiple(of: 7) }
      .collect(into: UniqueArray.self)
    // `transformed` holds all values that were previously in `items` that aren't a multiple of 7. `items` is now empty.

Like before, these are highly experimental, and they will definitely change in dramatic/radical ways on the way to stabilization. Note that there is no project- or team-wide consensus on any of these constructs. I'm publishing them primarily as a crucial reference point, and to gain a level of shared understanding of the actual problems that need to be resolved, and the consequences of the design path we are on.

What's Changed

New Contributors

Full Changelog: apple/swift-collections@1.4.0...1.4.1


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot merged commit d9b6c19 into main Mar 19, 2026
1 check passed
@renovate renovate Bot deleted the renovate/apple-swift-collections-1.x branch March 19, 2026 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants