From my perspective, this is the core issue here that has to be addressed in the first place. Currently, the parentheses-based literals are ambiguous and do not allow to use them universally:
val a = (1, "2") // tuple
val b = (1) // not a tuple
val c = () // nope!
and on the type level too:
type A = (Int, String) // tuple
type B = (Int) // not a tuple
type C = () // nope!
Personally, that issue bugs me way worse comparing to the lack of special syntax for collection literals (to be honest, the latter doesn’t bug me at all).
How does it relate to collection literals? That is simple: if Scala manages to fix the syntax for tuples and make it working for arities starting with 0, then we’ll get the full featured collection literals automatically:
type A = ?(Int, String) // Int *: String *: EmptyTuple
type B = ?(Int) // Int *: EmptyTuple
type C = ?() // EmptyTuple
val a = ?(1, "2") // Int *: String *: EmptyTuple
val b = ?(1) // Int *: EmptyTuple
val c = ?() // EmptyTuple
where ?( ... )
assumes any approach that would work here, I don’t mean the question mark specifically.
The important condition though to make it useful: it should work universally for both types and literals and for all arities starting with 0.
Otherwise, piling up []
syntax on top of the existing one would looks like that Scala leaves one controversy unresolved and introduces yet another one:
val a1 = Tuple() // works but sticks out
val a2 = [] // ok, but doesn't align with other Scala syntax
val b1 = Tuple(1) // works but sticks out
val b2 = [1] // ok, but doesn't align with other Scala syntax
val c1 = (1, 2) // ok
val c2 = [1, 2] // ok, but doesn't align with other Scala syntax
val d1 = (1, "two") // just fine too
val d2 = [1, "two"] // don't do this!
why there should be so many different ways in Scala to express similar things with so many caveats and catches for particular cases?
Not mentioning that if we need to create a collection of a particular type, not just a arbitrary sequence of items, then nothing can beat the direct syntax Vector(1, 2, 3)
.