[swift-evolution] Tuples as NominalTypes

Muhammad Tahir Vali tahir.vali13 at gmail.com
Fri Sep 16 09:05:00 CDT 2016


Type safety would make tuples far more powerful than their current
limitations. Structs are usually used for slightly more complex objects
compared to tuples and usually, you need them longer in memory. Tuples are
just for quick manipulation. Since you are interested in just the content
inside, you should be able to manipulate it quickly. Concrete examples
would be destructing JSON or manipulating any list. That manipulation
itself shouldn't be something used with Switch statements or require
multiple if let statements.

I'm actually not a fan of the C#'s implementation of tuples. Mainly because
they don't use optionals and the tuple implementation isn't very clean

var aTuple = Tuple.Create ("foo","bar",111)

The main problem is that Swift's tuples functionalities are very limited to
be able to use them.

-- 
Best Regards,

Muhammad T. Vali
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160916/b8847903/attachment.html>


More information about the swift-evolution mailing list