All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.arrow.core.Tuple4.kt Maven / Gradle / Ivy

There is a newer version: 2.0.1
Show newest version
@file:JvmMultifileClass
@file:JvmName("TupleNKt")

package arrow.core

import kotlin.jvm.JvmMultifileClass
import kotlin.jvm.JvmName

public data class Tuple4(
  val first: A,
  val second: B,
  val third: C,
  val fourth: D
) {

  override fun toString(): String =
    "($first, $second, $third, $fourth)"

  public companion object
}

public operator fun , B : Comparable, C : Comparable, D : Comparable> Tuple4.compareTo(other: Tuple4): Int {
  val first = first.compareTo(other.first)
  return if (first == 0) {
    val second = second.compareTo(other.second)
    if (second == 0) {
      val third = third.compareTo(other.third)
      if (third == 0) fourth.compareTo(other.fourth)
      else third
    } else second
  } else first
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy