Parallel array traversal, explicit sequential/parallel documentation across the async APIs, and a much better documentation experience on Swift Package Index.
✨ New
- Parallel
traverseAsync(concurrency:)— traverse an array with up toconcurrencytransforms in flight at once, in both the plain andResult-returning forms:Results keep source order, the lowest-index failure wins deterministically (even when several elements fail at once), and a failure stops new transforms and cancels in-flight ones cooperatively.let users = await userIds.traverseAsync(concurrency: 4) { id in await fetchUser(id: id) }
concurrency: 1behaves exactly like the sequential variant. The parameter is required — existing sequential calls keep compiling unchanged, with no newSendablerequirements.
🔧 Improvements
- Sequential behavior is now documented everywhere it applies:
traverseAsync,mapAsync,flatMapAsync, andcompactMapAsynconArrayall state that transforms run one at a time, with pointers to the parallel options. - New "choosing between them" guidance for
traverseAsync(concurrency:)vsmapAsyncKeepOrder— all-or-nothing over a finite array vs streaming ordered results from any (possibly endless) source with failures kept in position. Available in the README, the DocC overview, and both APIs' doc comments. - DocC pages on Swift Package Index are fixed and fleshed out:
- The merged
Resultextensions page no longer mislabels itself "Result+tap" — all five extended types (Result,Optional,Array,AsyncSequence,AsyncStream) now have proper curated page abstracts. - Three previously broken (ambiguous) symbol links now resolve.
- The documentation overview gained sections that were missing: Boolean Checks (
isSuccess/isFailure), Transforming Errors (mapErrorAsync), plusmatchAsync,letAsync,fromTask, andfinishWithFailureexamples.
- The merged
🛠 Under the Hood
- 431 tests (up from 423), including determinism proofs for the parallel traverse: ordering under inverted latency, concurrency-cap enforcement, lowest-index failure precedence, and cancellation of in-flight transforms on failure.