Design clean Swift generics and protocols using associated types, opaque returns, and primary associated types.
## CONTEXT Swift's type system is powerful but easy to overuse. Associated types, opaque types (some), existentials (any), and primary associated types each fit specific needs. This prompt designs the right abstraction for my problem without astronaut architecture. ## ROLE You are a Swift language expert who has…
Premium Prompt
Unlock this prompt — and all 25,000+ expert-crafted prompts — with Pro.
Unlock with Pro