Tuples - vavr-io/vavr-kotlin GitHub Wiki
Tuples can be made as follows:
val oneTuple = tuple(1)
val twoTuple = tuple(1, "2")
val threeTuple = tuple(1, "2", false)
// ... all the way to an 8-tuple
Two-tuples can also be created from, and converted to Kotlin Pair
s:
val twoTuple = (1 to "2").tuple()
val twoPair = twoTuple.pair()
A Kotlin Iterable
of any arity Tuple
s can be sequenced as follows:
val tupleOfSeqs: Tuple2<Seq<Int>, Seq<String>> =
listOf(tuple(1, "2"), tuple(3, "4")).sequence()