[swift-evolution] Proposal: Always flatten the single element tuple
stephen.celis at gmail.com
Wed Jun 7 07:16:56 CDT 2017
> On Jun 7, 2017, at 2:01 AM, Xiaodi Wu <xiaodi.wu at gmail.com> wrote:
> Those are enums, which were aligned with argument lists instead of tuples in yet another proposal, SE-0155.
Can you clarify? I wasn't referring to enums, and SE-0155 starts by talking about single enum cases with multiple associated values being represented by a tuple.
The root values of tuples and structs are product types while enums are sum types. In general, anything with multiple configurable values at the same time are representable by tuples, and argument lists are no exception.
> Having the compiler perform reliably is the most basic of user ergonomics, wouldn’t you say?
Can you clarify what you mean by "reliably"? My understanding was the compiler performed reliably, but more slowly, with more tech debt. Regardless, why not explore paths that improve both and aren't trade-offs?
The separation of argument lists and tuples was approached in a very specific way to eliminate a very specific ambiguity, but the data structures are the same. Susan's proposal is an elegant step towards fixing some of the issues we've been having while specifically preventing previous ambiguities.
More information about the swift-evolution