Skip to content

Instantly share code, notes, and snippets.

@swankjesse
Last active December 9, 2022 01:03
Show Gist options
  • Save swankjesse/095ccdcc7a95621f499b3548fc944b6d to your computer and use it in GitHub Desktop.
Save swankjesse/095ccdcc7a95621f499b3548fc944b6d to your computer and use it in GitHub Desktop.
fun main(args: Array<String>) {
println("a" to "b")
println("a" to "b" tre "c")
println("a" to "b" tre "c" fo "d")
println("a" to "b" tre "c" fo "d" fi "e")
println("a" to "b" tre "c" fo "d" fi "e" sik "f")
println("a" to "b" tre "c" fo "d" fi "e" sik "f" seva "g")
}
infix fun <A, B, C> Pair<A, B>.tre(c: C) = Triple(first, second, c)
infix fun <A, B, C, D> Triple<A, B, C>.fo(d: D) = Quad(first, second, third, d)
infix fun <A, B, C, D, E> Quad<A, B, C, D>.fi(e: E) = Jackson(a, b, c, d, e)
infix fun <A, B, C, D, E, F> Jackson<A, B, C, D, E>.sik(f: F) = Rainbow(a, b, c, d, e, f)
infix fun <A, B, C, D, E, F, G> Rainbow<A, B, C, D, E, F>.seva(g: G) = Lucky(a, b, c, d, e, f, g)
data class Quad<out A, out B, out C, out D>(
val a: A,
val b: B,
val c: C,
val d: D
)
data class Jackson<out A, out B, out C, out D, out E>(
val a: A,
val b: B,
val c: C,
val d: D,
val e: E
)
data class Rainbow<out A, out B, out C, out D, out E, out F>(
val a: A,
val b: B,
val c: C,
val d: D,
val e: E,
val f: F
)
data class Lucky<out A, out B, out C, out D, out E, out F, out G>(
val a: A,
val b: B,
val c: C,
val d: D,
val e: E,
val f: F,
val g: G
)
@cgruber
Copy link

cgruber commented Dec 9, 2022

Clearly this needs:

data class Crazy<out A, out B, out C, out D, out E, out F, out G, out H>(
  val a: A,
  val b: B,
  val c: C,
  val d: D,
  val e: E,
  val f: F,
  val g: G,
  val h: H
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment