Skip to content

Propose Pack Destructuring & Pack Splitting #2796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

OguzYuuksel
Copy link

No description provided.

@OguzYuuksel OguzYuuksel force-pushed the pack-destructuring-and-pack-splitting branch 2 times, most recently from 8182b62 to 91eab4b Compare April 19, 2025 18:42
* Status: Draft

## Introduction
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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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:
Swift’s variadic generics story ([SE‑0393 “Parameter Packs”](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0393-parameter-packs.md) and [SE‑0408 “Pack Iteration”](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0408-pack-iteration.md)) 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:

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies, @PsychoH13 . I unintentionally performed a force update without reviewing your suggestions. Could you please resubmit them?

@OguzYuuksel OguzYuuksel force-pushed the pack-destructuring-and-pack-splitting branch from deb3046 to b544739 Compare April 19, 2025 19:47
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.

2 participants