now i am interested though is there a infix factor...
# announcements
n
now i am interested though is there a infix factory for Triple ?
l
Nope, would be ambiguous I think. How would you have written it?
k
infix fun <A, B, C> Pair<A, B>.to(third: C) = Triple(first, second, third)
a
I wonder if it's because of performance costs that we don't have that.
k
I think because it kind of behaves strangely:
Copy code
run {
    infix fun <A, B, C> Pair<A, B>.to(third: C) = Triple(first, second, third)
    println(1 to 2 to 3)
}
println(1 to 2 to 3)