io.foldright.cffu.kotlin.CffuTupleExtensions.kt Maven / Gradle / Ivy
package io.foldright.cffu.kotlin
import io.foldright.cffu.tuple.Tuple2
import io.foldright.cffu.tuple.Tuple3
import io.foldright.cffu.tuple.Tuple4
import io.foldright.cffu.tuple.Tuple5
/*
This file contains the destructuring declarations for cffu tuples
https://kotlinlang.org/docs/destructuring-declarations.html
*/
operator fun Tuple2.component1(): T1 = _1
operator fun Tuple2<*, T2>.component2(): T2 = _2
operator fun Tuple3.component1(): T1 = _1
operator fun Tuple3<*, T2, *>.component2(): T2 = _2
operator fun Tuple3<*, *, T3>.component3(): T3 = _3
operator fun Tuple4.component1(): T1 = _1
operator fun Tuple4<*, T2, *, *>.component2(): T2 = _2
operator fun Tuple4<*, *, T3, *>.component3(): T3 = _3
operator fun Tuple4<*, *, *, T4>.component4(): T4 = _4
operator fun Tuple5.component1(): T1 = _1
operator fun Tuple5<*, T2, *, *, *>.component2(): T2 = _2
operator fun Tuple5<*, *, T3, *, *>.component3(): T3 = _3
operator fun Tuple5<*, *, *, T4, *>.component4(): T4 = _4
operator fun Tuple5<*, *, *, *, T5>.component5(): T5 = _5