[swift-evolution] [Discussion] What is the future of tuples in Swift?

Adrian Zubarev adrian.zubarev at devandartist.com
Fri Mar 3 10:24:31 CST 2017


That’s what conditional conformances are made for in my opinion. The generics manifesto shows an example of equatable tuples iff every type is also equatable. That said, one probably should be able to extend a specific set of tuples to arithmetic operations if there is a need for that in your own project. I’m not saying that the standard library should do that, but we should have that ability to do that at some point, iff we’ll have parametrized extensions and generic variadics.


 

-- 
Adrian Zubarev
Sent with Airmail

Am 3. März 2017 um 16:53:03, Stephen Canon (scanon at apple.com) schrieb:

- vectors should (probably) have arithmetic operators. Tuples, even homogenous tuples, should (probably) not, because they may represent types for which arithmetic doesn’t make sense, or for which arithmetic might need to do different things per-lane.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20170303/99402267/attachment.html>


More information about the swift-evolution mailing list