Got a question about unpacking `Triple`s inside an...
# announcements
w
Got a question about unpacking `Triple`s inside an
Iterable.groupBy
call. I can do something like this:
Copy code
myTriples.groupBy( { Pair(it.first, it.second) }, { it.third } )
I’d like to be able to unpack my
Triple
for better readability. I tried in kotlin and it seems there’s an option of using
{}
to unpack:
Copy code
myTriples.groupBy{ (name, gender, value) ->
// somehow generate my key and value here like above
// something like: Pair(name, gender) to value
}
Is this possible?