com.natpryce.krouton.Tuples.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of krouton Show documentation
Show all versions of krouton Show documentation
Type-safe and compositional URL routing and reverse routing
package com.natpryce.krouton
data class Tuple2(val val1: T1, val val2: T2)
data class Tuple3(val val1: T1, val val2: T2, val val3: T3)
data class Tuple4(val val1: T1, val val2: T2, val val3: T3, val val4: T4)
data class Tuple5(val val1: T1, val val2: T2, val val3: T3, val val4: T4, val val5: T5)
fun tuple(val1: T1, val2: T2) = Tuple2(val1, val2)
fun tuple(val1: T1, val2: T2, val3: T3) = Tuple3(val1, val2, val3)
fun tuple(val1: T1, val2: T2, val3: T3, val4: T4) = Tuple4(val1, val2, val3, val4)
fun tuple(val1: T1, val2: T2, val3: T3, val4: T4, val5: T5) = Tuple5(val1, val2, val3, val4, val5)
fun tupleFlat(val1: T1, val2: T2) = Tuple2(val1, val2)
fun tupleFlat(val2: T1, t: Tuple2) = Tuple3(val2, t.val1, t.val2)
fun tupleFlat(val3: T1, t: Tuple3) = Tuple4(val3, t.val1, t.val2, t.val3)
fun tupleFlat(val4: T1, t: Tuple4) = Tuple5(val4, t.val1, t.val2, t.val3, t.val4)
fun tupleFlat(t1: Tuple2, val3: T3) = Tuple3(t1.val1, t1.val2, val3)
fun tupleFlat(t1: Tuple2, t2: Tuple2) = Tuple4(t1.val1, t1.val2, t2.val1, t2.val2)
fun tupleFlat(t1: Tuple2, t2: Tuple3) = Tuple5(t1.val1, t1.val2, t2.val1, t2.val2, t2.val3)
fun tupleFlat(t1: Tuple3, val4: T4) = Tuple4(t1.val1, t1.val2, t1.val3, val4)
fun tupleFlat(t1: Tuple3, t2: Tuple2) = Tuple5(t1.val1, t1.val2, t1.val3, t2.val1, t2.val2)
fun tupleFlat(t1: Tuple4, val5: T5) = Tuple5(t1.val1, t1.val2, t1.val3, t1.val4, val5)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy