Skip to content

Commit deb3046

Browse files
authored
Update NNNN-pack-destructuring-and-pack-splitting.md
1 parent 91eab4b commit deb3046

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

proposals/NNNN-pack-destructuring-and-pack-splitting.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Status: Draft
77

88
## Introduction
9-
Swift’s variadic generics story (SE‑0393 “Parameter Packs” and SE‑0404 “Pack Iteration”) unlocks powerful abstractions over arbitrary arities. However, two missing features—recursive decomposition of packs in patterns and split‑expansion of packs at call sites—force library authors into brittle workarounds like fixed‑arity overloads or type erasure. This proposal completes the variadic‑generic toolbox by introducing:
9+
Swift’s variadic generics story (SE‑0393 “Parameter Packs” and SE‑0408 “Pack Iteration”) unlocks powerful abstractions over arbitrary arities. However, two missing features—recursive decomposition of packs in patterns and split‑expansion of packs at call sites—force library authors into brittle workarounds like fixed‑arity overloads or type erasure. This proposal completes the variadic‑generic toolbox by introducing:
1010

1111
1. **Pack Destructuring in Patterns** – extract `head` and `tail` from a variadic tuple in a `let` or `switch` pattern.
1212
2. **Pack Splitting in Calls** – feed a single parameter‐pack expansion into separate head + tail parameters at call sites.
@@ -177,7 +177,7 @@ struct Zip<repeat each S>: Publisher {
177177

178178
## References
179179
1. [SE‑0393: Parameter Packs](https://github.com/apple/swift-evolution/blob/main/proposals/0393-parameter-packs.md) – Introduces variadic type‐parameter packs.
180-
2. [SE‑0404: Pack Iteration](https://github.com/apple/swift-evolution/blob/main/proposals/0404-pack-iteration.md) – Enables iteration over packs.
180+
2. [SE‑0408: Pack Iteration](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0408-pack-iteration.md) – Enables iteration over packs.
181181

182182
## Conclusion
183183
By adding pack destructuring in patterns and pack splitting in calls, this proposal fills the last gaps in Swift’s variadic‑generic capabilities. Library authors can now write truly recursive, zero‑overhead abstractions without fixed arity limits or type erasure, while preserving source and ABI compatibility.

0 commit comments

Comments
 (0)