[swift-evolution] Inquiry: Improved Composability of stdlib Collections?

Joe Groff jgroff at apple.com
Sat Dec 5 20:10:08 CST 2015


> On Dec 5, 2015, at 11:34 AM, plx via swift-evolution <swift-evolution at swift.org> wrote:
> 
> Swift’s standard library's core collections' value-like, copy-on-write behavior is handy in the small, but they compose rather poorly with each other: if you have e.g. [K:Set<V>], and plan to mutate the “inner" sets, it seems at present as if there is no way to avoid an unnecessary transient copy of each set for each mutation you perform upon it.
> 
> Various workarounds/solutions exist but all are full of unfortunate tradeoffs and/or limited further composability; in concrete cases you can do alright, but it’s hard to craft a generic solution that doesn’t inadvertently reintroduce the problem you started-out trying to solve.
> 
> Is anything currently on the roadmap to address this specifically — whether optimizer improvements, extended APIs, implementation adjustments, a `borrow` construct, or some other approach?
> 

Do you have specific examples of problems you're trying to solve?

-Joe

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151205/0a319485/attachment.html>


More information about the swift-evolution mailing list