There are no 1-tuples in Swift. This is perhaps questionable, but allows you to write `(1 + 2) * 3` rather than `(1 + 2).0 * 3`.
-
-
It's more like, a 1-tuple is synonymous with its element type, than that it doesn't exist
1 reply 0 retweets 1 like -
Could have Rust's escape hatch: (x,)
1 reply 0 retweets 0 likes -
Seems strictly better to avoid the need for that to ever exist
1 reply 0 retweets 0 likes -
…why does Rust need 1-tuples to be distinct from scalars? Generics are parametric…
2 replies 0 retweets 0 likes -
If tuples were nominal and (Rust|Swift|whatever) had variadic generics it would make sense.
1 reply 0 retweets 0 likes -
Macros maybe, but variadics in type system shouldn't impose the need to separate 1-tuples from scalars. Type signature indicates variadicity
1 reply 0 retweets 1 like
As someone who implements a shit ton of macros w/ Tuples, my life would be easier if 1-tuples didn't exist.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.