->
is just a sugar notation for a pair (a tuple of two items). The universal notation for tuples of any arity is a comma-delimited list in braces. E.g. (1,2,3)
is a tuple of three integers, while as in your example the expression 1 -> 2 -> 3
would desugar to ((1,2),3)
, which is a tuple of a tuple of two ints and an int.
What you're trying to achieve with your code simply doesn't make any sense. A Map
can be constructed from a list of pairs, treating the first element of the tuple as a key and the second as a value. Tuples of any other arities are not supported and wouldn't make sense in that case. You can however construct collections of other types (e.g., a List
) containing tuples of any arities.