It is generally not a good idea to think of the comma-operator as making "tuples". Pairs (as in your example) are still ok, but as you noticed, the syntax can be confusing because it hides the structure: (1,(2,3))
is the same as (1,2,3)
and the same as 1,2,3
.
Once you try making triplets you get into real trouble, because (1,2,3)
is indistinguishable from the nested pairs (1,(2,3))
. That's of course because it really is a nested pair, not a flat structure.
It is better style to use a specific functor, let's say t/N
. Then there is no ambiguity between t(1,2,3)
and t(1,t(2,3))
.