This discussion from Sum-tuples popped into my head over a more recent discussion with the problems of regular tuples, general syntax that uses parentheses, and single-element tuples.
The problem: tuples were overloaded for everything; all multi-element entities were supposed to be secretly implemented by tuples. That's why function parameter syntax was so chummy with tuples. Heck, ABI-level function passing explodes tuples, since tuples and function parameter packs weren't distinct. Now they are, but we still have the damage that a single-item tuple is a pain to use/interpret.
In the sum-tuple thread, anonymous sum tuples were expressed by a slightly different syntax for the standard tuples:
typealias RegularSumTuple = (| TypeWithOptionalLablel1, TypeWithOptionalLabel2, ... |) typealias TypeCollaspedSumTuple = (< Type1, Type2, ... >) typealias UncheckedSumTuple = @unsafe(< Type1, Type2, ... >)
Now I'm wondering if we should add a fourth special parentheses group, for product-tuples (i.e. regular tuples):
typealias Void = (* *) typealias SingleElementTuple = (* TypeWithOptionalLabel *) typealias MultipleElementTuple = (* TypeWithOptionalLabel1, TypeWithOptionalLabel2, ... *)
This gives an unambiguous syntax for product tuples distinct from expression-grouping or function parameter parentheses. It also gives an unambiguous syntax for single-element product tuples.
(* *)" remind me of Pascal comments. Maybe "