diff --git a/arrow-core-data/src/main/kotlin/arrow/core/Either.kt b/arrow-core-data/src/main/kotlin/arrow/core/Either.kt index c2ac96985..901bbb009 100644 --- a/arrow-core-data/src/main/kotlin/arrow/core/Either.kt +++ b/arrow-core-data/src/main/kotlin/arrow/core/Either.kt @@ -1067,7 +1067,11 @@ sealed class Either : EitherOf { * The left side of the disjoint union, as opposed to the [Right] side. */ @Suppress("DataClassPrivateConstructor") - data class Left @PublishedApi internal constructor(val a: A) : Either() { + data class Left @PublishedApi internal constructor( + @Deprecated("Use value instead", ReplaceWith("value")) + val a: A + ) : Either() { + val value: A = a override val isLeft = true override val isRight = false @@ -1082,7 +1086,11 @@ sealed class Either : EitherOf { * The right side of the disjoint union, as opposed to the [Left] side. */ @Suppress("DataClassPrivateConstructor") - data class Right @PublishedApi internal constructor(val b: B) : Either() { + data class Right @PublishedApi internal constructor( + @Deprecated("Use value instead", ReplaceWith("value")) + val b: B + ) : Either() { + val value: B = b override val isLeft = false override val isRight = true diff --git a/arrow-core-data/src/main/kotlin/arrow/core/Ior.kt b/arrow-core-data/src/main/kotlin/arrow/core/Ior.kt index b4223e5d2..0da2c0e7a 100644 --- a/arrow-core-data/src/main/kotlin/arrow/core/Ior.kt +++ b/arrow-core-data/src/main/kotlin/arrow/core/Ior.kt @@ -633,7 +633,7 @@ sealed class Ior : IorOf { override val isLeft: Boolean get() = false override val isBoth: Boolean get() = true - override fun toString(): String = "Ior.Both($leftValue, rightValue)" + override fun toString(): String = "Ior.Both($leftValue, $rightValue)" } @Deprecated( diff --git a/arrow-core-data/src/main/kotlin/arrow/core/Option.kt b/arrow-core-data/src/main/kotlin/arrow/core/Option.kt index 3b583dd14..29a3d476c 100644 --- a/arrow-core-data/src/main/kotlin/arrow/core/Option.kt +++ b/arrow-core-data/src/main/kotlin/arrow/core/Option.kt @@ -977,7 +977,11 @@ object None : Option() { override fun toString(): String = "Option.None" } -data class Some(val t: T) : Option() { +data class Some( + @Deprecated("Use value instead", ReplaceWith("value")) + val t: T +) : Option() { + val value: T = t override fun isEmpty() = false override fun toString(): String = "Option.Some($t)" diff --git a/arrow-core-data/src/main/kotlin/arrow/core/Tuple10.kt b/arrow-core-data/src/main/kotlin/arrow/core/Tuple10.kt index a39300155..ffa13c2d1 100644 --- a/arrow-core-data/src/main/kotlin/arrow/core/Tuple10.kt +++ b/arrow-core-data/src/main/kotlin/arrow/core/Tuple10.kt @@ -18,7 +18,39 @@ typealias Tuple10PartialOf = arrow.Kind9 Tuple10Of.fix(): Tuple10 = this as Tuple10 -data class Tuple10(val a: A, val b: B, val c: C, val d: D, val e: E, val f: F, val g: G, val h: H, val i: I, val j: J) : Tuple10Of { +data class Tuple10( + @Deprecated("Use first instead", ReplaceWith("first")) + val a: A, + @Deprecated("Use second instead", ReplaceWith("second")) + val b: B, + @Deprecated("Use third instead", ReplaceWith("third")) + val c: C, + @Deprecated("Use fourth instead", ReplaceWith("fourth")) + val d: D, + @Deprecated("Use fifth instead", ReplaceWith("fifth")) + val e: E, + @Deprecated("Use sixth instead", ReplaceWith("sixth")) + val f: F, + @Deprecated("Use seventh instead", ReplaceWith("seventh")) + val g: G, + @Deprecated("Use eighth instead", ReplaceWith("eighth")) + val h: H, + @Deprecated("Use ninth instead", ReplaceWith("ninth")) + val i: I, + @Deprecated("Use tenth instead", ReplaceWith("tenth")) + val j: J +) : Tuple10Of { + + val first: A = a + val second: B = b + val third: C = c + val fourth: D = d + val fifth: E = e + val sixth: F = f + val seventh: G = g + val eight: H = h + val ninth: I = i + val tenth: J = j @Deprecated(ShowDeprecation) fun show(SA: Show, SB: Show, SC: Show, SD: Show, SE: Show, SF: Show, SG: Show, SH: Show, SI: Show, SJ: Show): String = @@ -134,12 +166,12 @@ operator fun , B : Comparable, C : Comparable, D : Compa if (sixth == 0) { val seventh = g.compareTo(other.g) if (seventh == 0) { - val eigth = h.compareTo(other.h) - if (eigth == 0) { + val eighth = h.compareTo(other.h) + if (eighth == 0) { val ninth = i.compareTo(other.i) if (ninth == 0) j.compareTo(other.j) else ninth - } else eigth + } else eighth } else seventh } else sixth } else fifth diff --git a/arrow-core-data/src/main/kotlin/arrow/core/Tuple4.kt b/arrow-core-data/src/main/kotlin/arrow/core/Tuple4.kt index 629c53e1e..4485da929 100644 --- a/arrow-core-data/src/main/kotlin/arrow/core/Tuple4.kt +++ b/arrow-core-data/src/main/kotlin/arrow/core/Tuple4.kt @@ -18,7 +18,21 @@ typealias Tuple4PartialOf = arrow.Kind3 inline fun Tuple4Of.fix(): Tuple4 = this as Tuple4 -data class Tuple4(val a: A, val b: B, val c: C, val d: D) : Tuple4Of { +data class Tuple4( + @Deprecated("Use first instead", ReplaceWith("first")) + val a: A, + @Deprecated("Use second instead", ReplaceWith("second")) + val b: B, + @Deprecated("Use third instead", ReplaceWith("third")) + val c: C, + @Deprecated("Use fourth instead", ReplaceWith("fourth")) + val d: D +) : Tuple4Of { + + val first: A = a + val second: B = b + val third: C = c + val fourth: D = d @Deprecated(ShowDeprecation) fun show(SA: Show, SB: Show, SC: Show, SD: Show): String = diff --git a/arrow-core-data/src/main/kotlin/arrow/core/Tuple5.kt b/arrow-core-data/src/main/kotlin/arrow/core/Tuple5.kt index 7d8a610b9..182c45352 100644 --- a/arrow-core-data/src/main/kotlin/arrow/core/Tuple5.kt +++ b/arrow-core-data/src/main/kotlin/arrow/core/Tuple5.kt @@ -18,7 +18,24 @@ typealias Tuple5PartialOf = arrow.Kind4 inline fun Tuple5Of.fix(): Tuple5 = this as Tuple5 -data class Tuple5(val a: A, val b: B, val c: C, val d: D, val e: E) : Tuple5Of { +data class Tuple5( + @Deprecated("Use first instead", ReplaceWith("first")) + val a: A, + @Deprecated("Use second instead", ReplaceWith("second")) + val b: B, + @Deprecated("Use third instead", ReplaceWith("third")) + val c: C, + @Deprecated("Use fourth instead", ReplaceWith("fourth")) + val d: D, + @Deprecated("Use fifth instead", ReplaceWith("fifth")) + val e: E +) : Tuple5Of { + + val first: A = a + val second: B = b + val third: C = c + val fourth: D = d + val fifth: E = e @Deprecated(ShowDeprecation) fun show(SA: Show, SB: Show, SC: Show, SD: Show, SE: Show): String = diff --git a/arrow-core-data/src/main/kotlin/arrow/core/Tuple6.kt b/arrow-core-data/src/main/kotlin/arrow/core/Tuple6.kt index 588c22e57..1cd23a300 100644 --- a/arrow-core-data/src/main/kotlin/arrow/core/Tuple6.kt +++ b/arrow-core-data/src/main/kotlin/arrow/core/Tuple6.kt @@ -18,7 +18,28 @@ typealias Tuple6PartialOf = arrow.Kind5 inline fun Tuple6Of.fix(): Tuple6 = this as Tuple6 -data class Tuple6(val a: A, val b: B, val c: C, val d: D, val e: E, val f: F) : Tuple6Of { +data class Tuple6( + @Deprecated("Use first instead", ReplaceWith("first")) + val a: A, + @Deprecated("Use second instead", ReplaceWith("second")) + val b: B, + @Deprecated("Use third instead", ReplaceWith("third")) + val c: C, + @Deprecated("Use fourth instead", ReplaceWith("fourth")) + val d: D, + @Deprecated("Use fifth instead", ReplaceWith("fifth")) + val e: E, + @Deprecated("Use sixth instead", ReplaceWith("sixth")) + val f: F +) : Tuple6Of { + + val first: A = a + val second: B = b + val third: C = c + val fourth: D = d + val fifth: E = e + val sixth: F = f + @Deprecated(ShowDeprecation) fun show(SA: Show, SB: Show, SC: Show, SD: Show, SE: Show, SF: Show): String = "(" + listOf(SA.run { a.show() }, SB.run { b.show() }, SC.run { c.show() }, SD.run { d.show() }, SE.run { e.show() }, SF.run { f.show() }).joinToString(", ") + ")" diff --git a/arrow-core-data/src/main/kotlin/arrow/core/Tuple7.kt b/arrow-core-data/src/main/kotlin/arrow/core/Tuple7.kt index f5f31f9d7..87e03c532 100644 --- a/arrow-core-data/src/main/kotlin/arrow/core/Tuple7.kt +++ b/arrow-core-data/src/main/kotlin/arrow/core/Tuple7.kt @@ -18,7 +18,31 @@ typealias Tuple7PartialOf = arrow.Kind6 Tuple7Of.fix(): Tuple7 = this as Tuple7 -data class Tuple7(val a: A, val b: B, val c: C, val d: D, val e: E, val f: F, val g: G) : Tuple7Of { +data class Tuple7( + @Deprecated("Use first instead", ReplaceWith("first")) + val a: A, + @Deprecated("Use second instead", ReplaceWith("second")) + val b: B, + @Deprecated("Use third instead", ReplaceWith("third")) + val c: C, + @Deprecated("Use fourth instead", ReplaceWith("fourth")) + val d: D, + @Deprecated("Use fifth instead", ReplaceWith("fifth")) + val e: E, + @Deprecated("Use sixth instead", ReplaceWith("sixth")) + val f: F, + @Deprecated("Use seventh instead", ReplaceWith("seventh")) + val g: G +) : Tuple7Of { + + val first: A = a + val second: B = b + val third: C = c + val fourth: D = d + val fifth: E = e + val sixth: F = f + val seventh: G = g + @Deprecated(ShowDeprecation) fun show(SA: Show, SB: Show, SC: Show, SD: Show, SE: Show, SF: Show, SG: Show): String = "(" + listOf(SA.run { a.show() }, SB.run { b.show() }, SC.run { c.show() }, SD.run { d.show() }, SE.run { e.show() }, SF.run { f.show() }, SG.run { g.show() }).joinToString(", ") + ")" diff --git a/arrow-core-data/src/main/kotlin/arrow/core/Tuple8.kt b/arrow-core-data/src/main/kotlin/arrow/core/Tuple8.kt index f8c6cee8a..7328a947c 100644 --- a/arrow-core-data/src/main/kotlin/arrow/core/Tuple8.kt +++ b/arrow-core-data/src/main/kotlin/arrow/core/Tuple8.kt @@ -18,7 +18,34 @@ typealias Tuple8PartialOf = arrow.Kind7 Tuple8Of.fix(): Tuple8 = this as Tuple8 -data class Tuple8(val a: A, val b: B, val c: C, val d: D, val e: E, val f: F, val g: G, val h: H) : Tuple8Of { +data class Tuple8( + @Deprecated("Use first instead", ReplaceWith("first")) + val a: A, + @Deprecated("Use second instead", ReplaceWith("second")) + val b: B, + @Deprecated("Use third instead", ReplaceWith("third")) + val c: C, + @Deprecated("Use fourth instead", ReplaceWith("fourth")) + val d: D, + @Deprecated("Use fifth instead", ReplaceWith("fifth")) + val e: E, + @Deprecated("Use sixth instead", ReplaceWith("sixth")) + val f: F, + @Deprecated("Use seventh instead", ReplaceWith("seventh")) + val g: G, + @Deprecated("Use eighth instead", ReplaceWith("eighth")) + val h: H +) : Tuple8Of { + + val first: A = a + val second: B = b + val third: C = c + val fourth: D = d + val fifth: E = e + val sixth: F = f + val seventh: G = g + val eight: H = h + @Deprecated(ShowDeprecation) fun show(SA: Show, SB: Show, SC: Show, SD: Show, SE: Show, SF: Show, SG: Show, SH: Show): String = "(" + listOf(SA.run { a.show() }, SB.run { b.show() }, SC.run { c.show() }, SD.run { d.show() }, SE.run { e.show() }, SF.run { f.show() }, SG.run { g.show() }, SH.run { h.show() }).joinToString(", ") + ")" diff --git a/arrow-core-data/src/main/kotlin/arrow/core/Tuple9.kt b/arrow-core-data/src/main/kotlin/arrow/core/Tuple9.kt index 431495d21..4a7ee0e0a 100644 --- a/arrow-core-data/src/main/kotlin/arrow/core/Tuple9.kt +++ b/arrow-core-data/src/main/kotlin/arrow/core/Tuple9.kt @@ -18,7 +18,37 @@ typealias Tuple9PartialOf = arrow.Kind8 Tuple9Of.fix(): Tuple9 = this as Tuple9 -data class Tuple9(val a: A, val b: B, val c: C, val d: D, val e: E, val f: F, val g: G, val h: H, val i: I) : Tuple9Of { +data class Tuple9( + @Deprecated("Use first instead", ReplaceWith("first")) + val a: A, + @Deprecated("Use second instead", ReplaceWith("second")) + val b: B, + @Deprecated("Use third instead", ReplaceWith("third")) + val c: C, + @Deprecated("Use fourth instead", ReplaceWith("fourth")) + val d: D, + @Deprecated("Use fifth instead", ReplaceWith("fifth")) + val e: E, + @Deprecated("Use sixth instead", ReplaceWith("sixth")) + val f: F, + @Deprecated("Use seventh instead", ReplaceWith("seventh")) + val g: G, + @Deprecated("Use eighth instead", ReplaceWith("eighth")) + val h: H, + @Deprecated("Use ninth instead", ReplaceWith("ninth")) + val i: I +) : Tuple9Of { + + val first: A = a + val second: B = b + val third: C = c + val fourth: D = d + val fifth: E = e + val sixth: F = f + val seventh: G = g + val eight: H = h + val ninth: I = i + @Deprecated(ShowDeprecation) fun show(SA: Show, SB: Show, SC: Show, SD: Show, SE: Show, SF: Show, SG: Show, SH: Show, SI: Show): String = "(" + listOf(SA.run { a.show() }, SB.run { b.show() }, SC.run { c.show() }, SD.run { d.show() }, SE.run { e.show() }, SF.run { f.show() }, SG.run { g.show() }, SH.run { h.show() }, SI.run { i.show() }).joinToString(", ") + ")" @@ -126,9 +156,9 @@ operator fun , B : Comparable, C : Comparable, D : Compa if (sixth == 0) { val seventh = g.compareTo(other.g) if (seventh == 0) { - val eigth = h.compareTo(other.h) - if (eigth == 0) i.compareTo(other.i) - else eigth + val eighth = h.compareTo(other.h) + if (eighth == 0) i.compareTo(other.i) + else eighth } else seventh } else sixth } else fifth diff --git a/arrow-core-data/src/main/kotlin/arrow/core/TupleN.kt b/arrow-core-data/src/main/kotlin/arrow/core/TupleN.kt index b919014dc..b79269839 100644 --- a/arrow-core-data/src/main/kotlin/arrow/core/TupleN.kt +++ b/arrow-core-data/src/main/kotlin/arrow/core/TupleN.kt @@ -6,7 +6,9 @@ package arrow.core import java.util.Collections import kotlin.collections.LinkedHashMap -class ForTuple11 private constructor() { companion object } +class ForTuple11 private constructor() { + companion object +} typealias Tuple11Of = arrow.Kind11 typealias Tuple11PartialOf = arrow.Kind10 @@ -14,11 +16,48 @@ typealias Tuple11PartialOf = arrow.Kind10 Tuple11Of.fix(): Tuple11 = this as Tuple11 -data class Tuple11(val a: A, val b: B, val c: C, val d: D, val e: E, val f: F, val g: G, val h: H, val i: I, val j: J, val k: K) : Tuple11Of { +data class Tuple11( + @Deprecated("Use first instead", ReplaceWith("first")) + val a: A, + @Deprecated("Use second instead", ReplaceWith("second")) + val b: B, + @Deprecated("Use third instead", ReplaceWith("third")) + val c: C, + @Deprecated("Use fourth instead", ReplaceWith("fourth")) + val d: D, + @Deprecated("Use fifth instead", ReplaceWith("fifth")) + val e: E, + @Deprecated("Use sixth instead", ReplaceWith("sixth")) + val f: F, + @Deprecated("Use seventh instead", ReplaceWith("seventh")) + val g: G, + @Deprecated("Use eighth instead", ReplaceWith("eighth")) + val h: H, + @Deprecated("Use ninth instead", ReplaceWith("ninth")) + val i: I, + @Deprecated("Use tenth instead", ReplaceWith("tenth")) + val j: J, + @Deprecated("Use eleventh instead", ReplaceWith("eleventh")) + val k: K +) : Tuple11Of { + val first: A = a + val second: B = b + val third: C = c + val fourth: D = d + val fifth: E = e + val sixth: F = f + val seventh: G = g + val eight: H = h + val ninth: I = i + val tenth: J = j + val eleventh: K = k + companion object } -class ForTuple12 private constructor() { companion object } +class ForTuple12 private constructor() { + companion object +} typealias Tuple12Of = arrow.Kind12 typealias Tuple12PartialOf = arrow.Kind11 @@ -26,11 +65,51 @@ typealias Tuple12PartialOf = arrow.Kind11 Tuple12Of.fix(): Tuple12 = this as Tuple12 -data class Tuple12(val a: A, val b: B, val c: C, val d: D, val e: E, val f: F, val g: G, val h: H, val i: I, val j: J, val k: K, val l: L) : Tuple12Of { +data class Tuple12( + @Deprecated("Use first instead", ReplaceWith("first")) + val a: A, + @Deprecated("Use second instead", ReplaceWith("second")) + val b: B, + @Deprecated("Use third instead", ReplaceWith("third")) + val c: C, + @Deprecated("Use fourth instead", ReplaceWith("fourth")) + val d: D, + @Deprecated("Use fifth instead", ReplaceWith("fifth")) + val e: E, + @Deprecated("Use sixth instead", ReplaceWith("sixth")) + val f: F, + @Deprecated("Use seventh instead", ReplaceWith("seventh")) + val g: G, + @Deprecated("Use eighth instead", ReplaceWith("eighth")) + val h: H, + @Deprecated("Use ninth instead", ReplaceWith("ninth")) + val i: I, + @Deprecated("Use tenth instead", ReplaceWith("tenth")) + val j: J, + @Deprecated("Use eleventh instead", ReplaceWith("eleventh")) + val k: K, + @Deprecated("Use twelfth instead", ReplaceWith("twelfth")) + val l: L +) : Tuple12Of { + val first: A = a + val second: B = b + val third: C = c + val fourth: D = d + val fifth: E = e + val sixth: F = f + val seventh: G = g + val eight: H = h + val ninth: I = i + val tenth: J = j + val eleventh: K = k + val twelfth: L = l + companion object } -class ForTuple13 private constructor() { companion object } +class ForTuple13 private constructor() { + companion object +} typealias Tuple13Of = arrow.Kind13 typealias Tuple13PartialOf = arrow.Kind12 @@ -38,11 +117,54 @@ typealias Tuple13PartialOf = arrow.Kind12 Tuple13Of.fix(): Tuple13 = this as Tuple13 -data class Tuple13(val a: A, val b: B, val c: C, val d: D, val e: E, val f: F, val g: G, val h: H, val i: I, val j: J, val k: K, val l: L, val m: M) : Tuple13Of { +data class Tuple13( + @Deprecated("Use first instead", ReplaceWith("first")) + val a: A, + @Deprecated("Use second instead", ReplaceWith("second")) + val b: B, + @Deprecated("Use third instead", ReplaceWith("third")) + val c: C, + @Deprecated("Use fourth instead", ReplaceWith("fourth")) + val d: D, + @Deprecated("Use fifth instead", ReplaceWith("fifth")) + val e: E, + @Deprecated("Use sixth instead", ReplaceWith("sixth")) + val f: F, + @Deprecated("Use seventh instead", ReplaceWith("seventh")) + val g: G, + @Deprecated("Use eighth instead", ReplaceWith("eighth")) + val h: H, + @Deprecated("Use ninth instead", ReplaceWith("ninth")) + val i: I, + @Deprecated("Use tenth instead", ReplaceWith("tenth")) + val j: J, + @Deprecated("Use eleventh instead", ReplaceWith("eleventh")) + val k: K, + @Deprecated("Use twelfth instead", ReplaceWith("twelfth")) + val l: L, + @Deprecated("Use thirteenth instead", ReplaceWith("thirteenth")) + val m: M +) : Tuple13Of { + val first: A = a + val second: B = b + val third: C = c + val fourth: D = d + val fifth: E = e + val sixth: F = f + val seventh: G = g + val eight: H = h + val ninth: I = i + val tenth: J = j + val eleventh: K = k + val twelfth: L = l + val thirteenth: M = m + companion object } -class ForTuple14 private constructor() { companion object } +class ForTuple14 private constructor() { + companion object +} typealias Tuple14Of = arrow.Kind14 typealias Tuple14PartialOf = arrow.Kind13 @@ -50,11 +172,57 @@ typealias Tuple14PartialOf = arrow.Kind13 inline fun Tuple14Of.fix(): Tuple14 = this as Tuple14 -data class Tuple14(val a: A, val b: B, val c: C, val d: D, val e: E, val f: F, val g: G, val h: H, val i: I, val j: J, val k: K, val l: L, val m: M, val n: N) : Tuple14Of { +data class Tuple14( + @Deprecated("Use first instead", ReplaceWith("first")) + val a: A, + @Deprecated("Use second instead", ReplaceWith("second")) + val b: B, + @Deprecated("Use third instead", ReplaceWith("third")) + val c: C, + @Deprecated("Use fourth instead", ReplaceWith("fourth")) + val d: D, + @Deprecated("Use fifth instead", ReplaceWith("fifth")) + val e: E, + @Deprecated("Use sixth instead", ReplaceWith("sixth")) + val f: F, + @Deprecated("Use seventh instead", ReplaceWith("seventh")) + val g: G, + @Deprecated("Use eighth instead", ReplaceWith("eighth")) + val h: H, + @Deprecated("Use ninth instead", ReplaceWith("ninth")) + val i: I, + @Deprecated("Use tenth instead", ReplaceWith("tenth")) + val j: J, + @Deprecated("Use eleventh instead", ReplaceWith("eleventh")) + val k: K, + @Deprecated("Use twelfth instead", ReplaceWith("twelfth")) + val l: L, + @Deprecated("Use thirteenth instead", ReplaceWith("thirteenth")) + val m: M, + @Deprecated("Use fourteenth instead", ReplaceWith("fourteenth")) + val n: N +) : Tuple14Of { + val first: A = a + val second: B = b + val third: C = c + val fourth: D = d + val fifth: E = e + val sixth: F = f + val seventh: G = g + val eight: H = h + val ninth: I = i + val tenth: J = j + val eleventh: K = k + val twelfth: L = l + val thirteenth: M = m + val fourteenth: N = n + companion object } -class ForTuple15 private constructor() { companion object } +class ForTuple15 private constructor() { + companion object +} typealias Tuple15Of = arrow.Kind15 typealias Tuple15PartialOf = arrow.Kind14 @@ -62,11 +230,60 @@ typealias Tuple15PartialOf = arrow.Kin inline fun Tuple15Of.fix(): Tuple15 = this as Tuple15 -data class Tuple15(val a: A, val b: B, val c: C, val d: D, val e: E, val f: F, val g: G, val h: H, val i: I, val j: J, val k: K, val l: L, val m: M, val n: N, val o: O) : Tuple15Of { +data class Tuple15( + @Deprecated("Use first instead", ReplaceWith("first")) + val a: A, + @Deprecated("Use second instead", ReplaceWith("second")) + val b: B, + @Deprecated("Use third instead", ReplaceWith("third")) + val c: C, + @Deprecated("Use fourth instead", ReplaceWith("fourth")) + val d: D, + @Deprecated("Use fifth instead", ReplaceWith("fifth")) + val e: E, + @Deprecated("Use sixth instead", ReplaceWith("sixth")) + val f: F, + @Deprecated("Use seventh instead", ReplaceWith("seventh")) + val g: G, + @Deprecated("Use eighth instead", ReplaceWith("eighth")) + val h: H, + @Deprecated("Use ninth instead", ReplaceWith("ninth")) + val i: I, + @Deprecated("Use tenth instead", ReplaceWith("tenth")) + val j: J, + @Deprecated("Use eleventh instead", ReplaceWith("eleventh")) + val k: K, + @Deprecated("Use twelfth instead", ReplaceWith("twelfth")) + val l: L, + @Deprecated("Use thirteenth instead", ReplaceWith("thirteenth")) + val m: M, + @Deprecated("Use fourteenth instead", ReplaceWith("fourteenth")) + val n: N, + @Deprecated("Use fifteenth instead", ReplaceWith("fifteenth")) + val o: O +) : Tuple15Of { + val first: A = a + val second: B = b + val third: C = c + val fourth: D = d + val fifth: E = e + val sixth: F = f + val seventh: G = g + val eight: H = h + val ninth: I = i + val tenth: J = j + val eleventh: K = k + val twelfth: L = l + val thirteenth: M = m + val fourteenth: N = n + val fifteenth: O = o + companion object } -class ForTuple16 private constructor() { companion object } +class ForTuple16 private constructor() { + companion object +} typealias Tuple16Of = arrow.Kind16 typealias Tuple16PartialOf = arrow.Kind15 @@ -74,11 +291,63 @@ typealias Tuple16PartialOf = arrow. inline fun Tuple16Of.fix(): Tuple16 = this as Tuple16 -data class Tuple16(val a: A, val b: B, val c: C, val d: D, val e: E, val f: F, val g: G, val h: H, val i: I, val j: J, val k: K, val l: L, val m: M, val n: N, val o: O, val p: P) : Tuple16Of { +data class Tuple16( + @Deprecated("Use first instead", ReplaceWith("first")) + val a: A, + @Deprecated("Use second instead", ReplaceWith("second")) + val b: B, + @Deprecated("Use third instead", ReplaceWith("third")) + val c: C, + @Deprecated("Use fourth instead", ReplaceWith("fourth")) + val d: D, + @Deprecated("Use fifth instead", ReplaceWith("fifth")) + val e: E, + @Deprecated("Use sixth instead", ReplaceWith("sixth")) + val f: F, + @Deprecated("Use seventh instead", ReplaceWith("seventh")) + val g: G, + @Deprecated("Use eighth instead", ReplaceWith("eighth")) + val h: H, + @Deprecated("Use ninth instead", ReplaceWith("ninth")) + val i: I, + @Deprecated("Use tenth instead", ReplaceWith("tenth")) + val j: J, + @Deprecated("Use eleventh instead", ReplaceWith("eleventh")) + val k: K, + @Deprecated("Use twelfth instead", ReplaceWith("twelfth")) + val l: L, + @Deprecated("Use thirteenth instead", ReplaceWith("thirteenth")) + val m: M, + @Deprecated("Use fourteenth instead", ReplaceWith("fourteenth")) + val n: N, + @Deprecated("Use fifteenth instead", ReplaceWith("fifteenth")) + val o: O, + @Deprecated("Use sixteenth instead", ReplaceWith("sixteenth")) + val p: P +) : Tuple16Of { + val first: A = a + val second: B = b + val third: C = c + val fourth: D = d + val fifth: E = e + val sixth: F = f + val seventh: G = g + val eight: H = h + val ninth: I = i + val tenth: J = j + val eleventh: K = k + val twelfth: L = l + val thirteenth: M = m + val fourteenth: N = n + val fifteenth: O = o + val sixteenth: P = p + companion object } -class ForTuple17 private constructor() { companion object } +class ForTuple17 private constructor() { + companion object +} typealias Tuple17Of = arrow.Kind17 typealias Tuple17PartialOf = arrow.Kind16 @@ -86,11 +355,66 @@ typealias Tuple17PartialOf = arr inline fun Tuple17Of.fix(): Tuple17 = this as Tuple17 -data class Tuple17(val a: A, val b: B, val c: C, val d: D, val e: E, val f: F, val g: G, val h: H, val i: I, val j: J, val k: K, val l: L, val m: M, val n: N, val o: O, val p: P, val q: Q) : Tuple17Of { +data class Tuple17( + @Deprecated("Use first instead", ReplaceWith("first")) + val a: A, + @Deprecated("Use second instead", ReplaceWith("second")) + val b: B, + @Deprecated("Use third instead", ReplaceWith("third")) + val c: C, + @Deprecated("Use fourth instead", ReplaceWith("fourth")) + val d: D, + @Deprecated("Use fifth instead", ReplaceWith("fifth")) + val e: E, + @Deprecated("Use sixth instead", ReplaceWith("sixth")) + val f: F, + @Deprecated("Use seventh instead", ReplaceWith("seventh")) + val g: G, + @Deprecated("Use eighth instead", ReplaceWith("eighth")) + val h: H, + @Deprecated("Use ninth instead", ReplaceWith("ninth")) + val i: I, + @Deprecated("Use tenth instead", ReplaceWith("tenth")) + val j: J, + @Deprecated("Use eleventh instead", ReplaceWith("eleventh")) + val k: K, + @Deprecated("Use twelfth instead", ReplaceWith("twelfth")) + val l: L, + @Deprecated("Use thirteenth instead", ReplaceWith("thirteenth")) + val m: M, + @Deprecated("Use fourteenth instead", ReplaceWith("fourteenth")) + val n: N, + @Deprecated("Use fifteenth instead", ReplaceWith("fifteenth")) + val o: O, + @Deprecated("Use sixteenth instead", ReplaceWith("sixteenth")) + val p: P, + @Deprecated("Use seventeenth instead", ReplaceWith("seventeenth")) + val q: Q +) : Tuple17Of { + val first: A = a + val second: B = b + val third: C = c + val fourth: D = d + val fifth: E = e + val sixth: F = f + val seventh: G = g + val eight: H = h + val ninth: I = i + val tenth: J = j + val eleventh: K = k + val twelfth: L = l + val thirteenth: M = m + val fourteenth: N = n + val fifteenth: O = o + val sixteenth: P = p + val seventeenth: Q = q + companion object } -class ForTuple18 private constructor() { companion object } +class ForTuple18 private constructor() { + companion object +} typealias Tuple18Of = arrow.Kind18 typealias Tuple18PartialOf = arrow.Kind17 @@ -98,11 +422,69 @@ typealias Tuple18PartialOf = inline fun Tuple18Of.fix(): Tuple18 = this as Tuple18 -data class Tuple18(val a: A, val b: B, val c: C, val d: D, val e: E, val f: F, val g: G, val h: H, val i: I, val j: J, val k: K, val l: L, val m: M, val n: N, val o: O, val p: P, val q: Q, val r: R) : Tuple18Of { +data class Tuple18( + @Deprecated("Use first instead", ReplaceWith("first")) + val a: A, + @Deprecated("Use second instead", ReplaceWith("second")) + val b: B, + @Deprecated("Use third instead", ReplaceWith("third")) + val c: C, + @Deprecated("Use fourth instead", ReplaceWith("fourth")) + val d: D, + @Deprecated("Use fifth instead", ReplaceWith("fifth")) + val e: E, + @Deprecated("Use sixth instead", ReplaceWith("sixth")) + val f: F, + @Deprecated("Use seventh instead", ReplaceWith("seventh")) + val g: G, + @Deprecated("Use eighth instead", ReplaceWith("eighth")) + val h: H, + @Deprecated("Use ninth instead", ReplaceWith("ninth")) + val i: I, + @Deprecated("Use tenth instead", ReplaceWith("tenth")) + val j: J, + @Deprecated("Use eleventh instead", ReplaceWith("eleventh")) + val k: K, + @Deprecated("Use twelfth instead", ReplaceWith("twelfth")) + val l: L, + @Deprecated("Use thirteenth instead", ReplaceWith("thirteenth")) + val m: M, + @Deprecated("Use fourteenth instead", ReplaceWith("fourteenth")) + val n: N, + @Deprecated("Use fifteenth instead", ReplaceWith("fifteenth")) + val o: O, + @Deprecated("Use sixteenth instead", ReplaceWith("sixteenth")) + val p: P, + @Deprecated("Use seventeenth instead", ReplaceWith("seventeenth")) + val q: Q, + @Deprecated("Use eighteenth instead", ReplaceWith("eighteenth")) + val r: R +) : Tuple18Of { + val first: A = a + val second: B = b + val third: C = c + val fourth: D = d + val fifth: E = e + val sixth: F = f + val seventh: G = g + val eight: H = h + val ninth: I = i + val tenth: J = j + val eleventh: K = k + val twelfth: L = l + val thirteenth: M = m + val fourteenth: N = n + val fifteenth: O = o + val sixteenth: P = p + val seventeenth: Q = q + val eighteenth: R = r + companion object } -class ForTuple19 private constructor() { companion object } +class ForTuple19 private constructor() { + companion object +} typealias Tuple19Of = arrow.Kind19 typealias Tuple19PartialOf = arrow.Kind18 @@ -110,11 +492,72 @@ typealias Tuple19PartialOf inline fun Tuple19Of.fix(): Tuple19 = this as Tuple19 -data class Tuple19(val a: A, val b: B, val c: C, val d: D, val e: E, val f: F, val g: G, val h: H, val i: I, val j: J, val k: K, val l: L, val m: M, val n: N, val o: O, val p: P, val q: Q, val r: R, val s: S) : Tuple19Of { +data class Tuple19( + @Deprecated("Use first instead", ReplaceWith("first")) + val a: A, + @Deprecated("Use second instead", ReplaceWith("second")) + val b: B, + @Deprecated("Use third instead", ReplaceWith("third")) + val c: C, + @Deprecated("Use fourth instead", ReplaceWith("fourth")) + val d: D, + @Deprecated("Use fifth instead", ReplaceWith("fifth")) + val e: E, + @Deprecated("Use sixth instead", ReplaceWith("sixth")) + val f: F, + @Deprecated("Use seventh instead", ReplaceWith("seventh")) + val g: G, + @Deprecated("Use eighth instead", ReplaceWith("eighth")) + val h: H, + @Deprecated("Use ninth instead", ReplaceWith("ninth")) + val i: I, + @Deprecated("Use tenth instead", ReplaceWith("tenth")) + val j: J, + @Deprecated("Use eleventh instead", ReplaceWith("eleventh")) + val k: K, + @Deprecated("Use twelfth instead", ReplaceWith("twelfth")) + val l: L, + @Deprecated("Use thirteenth instead", ReplaceWith("thirteenth")) + val m: M, + @Deprecated("Use fourteenth instead", ReplaceWith("fourteenth")) + val n: N, + @Deprecated("Use fifteenth instead", ReplaceWith("fifteenth")) + val o: O, + @Deprecated("Use sixteenth instead", ReplaceWith("sixteenth")) + val p: P, + @Deprecated("Use seventeenth instead", ReplaceWith("seventeenth")) + val q: Q, + @Deprecated("Use eighteenth instead", ReplaceWith("eighteenth")) + val r: R, + @Deprecated("Use nineteenth instead", ReplaceWith("nineteenth")) + val s: S +) : Tuple19Of { + val first: A = a + val second: B = b + val third: C = c + val fourth: D = d + val fifth: E = e + val sixth: F = f + val seventh: G = g + val eight: H = h + val ninth: I = i + val tenth: J = j + val eleventh: K = k + val twelfth: L = l + val thirteenth: M = m + val fourteenth: N = n + val fifteenth: O = o + val sixteenth: P = p + val seventeenth: Q = q + val eighteenth: R = r + val nineteenth: S = s + companion object } -class ForTuple20 private constructor() { companion object } +class ForTuple20 private constructor() { + companion object +} typealias Tuple20Of = arrow.Kind20 typealias Tuple20PartialOf = arrow.Kind19 @@ -122,11 +565,75 @@ typealias Tuple20PartialOf Tuple20Of.fix(): Tuple20 = this as Tuple20 -data class Tuple20(val a: A, val b: B, val c: C, val d: D, val e: E, val f: F, val g: G, val h: H, val i: I, val j: J, val k: K, val l: L, val m: M, val n: N, val o: O, val p: P, val q: Q, val r: R, val s: S, val t: T) : Tuple20Of { +data class Tuple20( + @Deprecated("Use first instead", ReplaceWith("first")) + val a: A, + @Deprecated("Use second instead", ReplaceWith("second")) + val b: B, + @Deprecated("Use third instead", ReplaceWith("third")) + val c: C, + @Deprecated("Use fourth instead", ReplaceWith("fourth")) + val d: D, + @Deprecated("Use fifth instead", ReplaceWith("fifth")) + val e: E, + @Deprecated("Use sixth instead", ReplaceWith("sixth")) + val f: F, + @Deprecated("Use seventh instead", ReplaceWith("seventh")) + val g: G, + @Deprecated("Use eighth instead", ReplaceWith("eighth")) + val h: H, + @Deprecated("Use ninth instead", ReplaceWith("ninth")) + val i: I, + @Deprecated("Use tenth instead", ReplaceWith("tenth")) + val j: J, + @Deprecated("Use eleventh instead", ReplaceWith("eleventh")) + val k: K, + @Deprecated("Use twelfth instead", ReplaceWith("twelfth")) + val l: L, + @Deprecated("Use thirteenth instead", ReplaceWith("thirteenth")) + val m: M, + @Deprecated("Use fourteenth instead", ReplaceWith("fourteenth")) + val n: N, + @Deprecated("Use fifteenth instead", ReplaceWith("fifteenth")) + val o: O, + @Deprecated("Use sixteenth instead", ReplaceWith("sixteenth")) + val p: P, + @Deprecated("Use seventeenth instead", ReplaceWith("seventeenth")) + val q: Q, + @Deprecated("Use eighteenth instead", ReplaceWith("eighteenth")) + val r: R, + @Deprecated("Use nineteenth instead", ReplaceWith("nineteenth")) + val s: S, + @Deprecated("Use twentieth instead", ReplaceWith("twentieth")) + val t: T +) : Tuple20Of { + val first: A = a + val second: B = b + val third: C = c + val fourth: D = d + val fifth: E = e + val sixth: F = f + val seventh: G = g + val eight: H = h + val ninth: I = i + val tenth: J = j + val eleventh: K = k + val twelfth: L = l + val thirteenth: M = m + val fourteenth: N = n + val fifteenth: O = o + val sixteenth: P = p + val seventeenth: Q = q + val eighteenth: R = r + val nineteenth: S = s + val twentieth: T = t + companion object } -class ForTuple21 private constructor() { companion object } +class ForTuple21 private constructor() { + companion object +} typealias Tuple21Of = arrow.Kind21 typealias Tuple21PartialOf = arrow.Kind20 @@ -134,11 +641,77 @@ typealias Tuple21PartialOf Tuple21Of.fix(): Tuple21 = this as Tuple21 -data class Tuple21(val a: A, val b: B, val c: C, val d: D, val e: E, val f: F, val g: G, val h: H, val i: I, val j: J, val k: K, val l: L, val m: M, val n: N, val o: O, val p: P, val q: Q, val r: R, val s: S, val t: T, val u: U) : Tuple21Of { +data class Tuple21( + @Deprecated("Use first instead", ReplaceWith("first")) + val a: A, + @Deprecated("Use second instead", ReplaceWith("second")) + val b: B, + @Deprecated("Use third instead", ReplaceWith("third")) + val c: C, + @Deprecated("Use fourth instead", ReplaceWith("fourth")) + val d: D, + @Deprecated("Use fifth instead", ReplaceWith("fifth")) + val e: E, + @Deprecated("Use sixth instead", ReplaceWith("sixth")) + val f: F, + @Deprecated("Use seventh instead", ReplaceWith("seventh")) + val g: G, + @Deprecated("Use eighth instead", ReplaceWith("eighth")) + val h: H, + @Deprecated("Use ninth instead", ReplaceWith("ninth")) + val i: I, + @Deprecated("Use tenth instead", ReplaceWith("tenth")) + val j: J, + @Deprecated("Use eleventh instead", ReplaceWith("eleventh")) + val k: K, + @Deprecated("Use twelfth instead", ReplaceWith("twelfth")) + val l: L, + @Deprecated("Use thirteenth instead", ReplaceWith("thirteenth")) + val m: M, + @Deprecated("Use fourteenth instead", ReplaceWith("fourteenth")) + val n: N, + @Deprecated("Use fifteenth instead", ReplaceWith("fifteenth")) + val o: O, + @Deprecated("Use sixteenth instead", ReplaceWith("sixteenth")) + val p: P, + @Deprecated("Use seventeenth instead", ReplaceWith("seventeenth")) + val q: Q, + @Deprecated("Use eighteenth instead", ReplaceWith("eighteenth")) + val r: R, + @Deprecated("Use nineteenth instead", ReplaceWith("nineteenth")) + val s: S, + @Deprecated("Use twentieth instead", ReplaceWith("twentieth")) + val t: T, + @Deprecated("Use twentyFirst instead", ReplaceWith("twentyFirst")) + val u: U +) : Tuple21Of { + val first: A = a + val second: B = b + val third: C = c + val fourth: D = d + val fifth: E = e + val sixth: F = f + val seventh: G = g + val eight: H = h + val ninth: I = i + val tenth: J = j + val eleventh: K = k + val twelfth: L = l + val thirteenth: M = m + val fourteenth: N = n + val fifteenth: O = o + val sixteenth: P = p + val seventeenth: Q = q + val eighteenth: R = r + val nineteenth: S = s + val twentyFirst: U = u + companion object } -class ForTuple22 private constructor() { companion object } +class ForTuple22 private constructor() { + companion object +} typealias Tuple22Of = arrow.Kind22 typealias Tuple22PartialOf = arrow.Kind21 @@ -146,7 +719,74 @@ typealias Tuple22PartialOf Tuple22Of.fix(): Tuple22 = this as Tuple22 -data class Tuple22(val a: A, val b: B, val c: C, val d: D, val e: E, val f: F, val g: G, val h: H, val i: I, val j: J, val k: K, val l: L, val m: M, val n: N, val o: O, val p: P, val q: Q, val r: R, val s: S, val t: T, val u: U, val v: V) : Tuple22Of { +data class Tuple22( + @Deprecated("Use first instead", ReplaceWith("first")) + val a: A, + @Deprecated("Use second instead", ReplaceWith("second")) + val b: B, + @Deprecated("Use third instead", ReplaceWith("third")) + val c: C, + @Deprecated("Use fourth instead", ReplaceWith("fourth")) + val d: D, + @Deprecated("Use fifth instead", ReplaceWith("fifth")) + val e: E, + @Deprecated("Use sixth instead", ReplaceWith("sixth")) + val f: F, + @Deprecated("Use seventh instead", ReplaceWith("seventh")) + val g: G, + @Deprecated("Use eighth instead", ReplaceWith("eighth")) + val h: H, + @Deprecated("Use ninth instead", ReplaceWith("ninth")) + val i: I, + @Deprecated("Use tenth instead", ReplaceWith("tenth")) + val j: J, + @Deprecated("Use eleventh instead", ReplaceWith("eleventh")) + val k: K, + @Deprecated("Use twelfth instead", ReplaceWith("twelfth")) + val l: L, + @Deprecated("Use thirteenth instead", ReplaceWith("thirteenth")) + val m: M, + @Deprecated("Use fourteenth instead", ReplaceWith("fourteenth")) + val n: N, + @Deprecated("Use fifteenth instead", ReplaceWith("fifteenth")) + val o: O, + @Deprecated("Use sixteenth instead", ReplaceWith("sixteenth")) + val p: P, + @Deprecated("Use seventeenth instead", ReplaceWith("seventeenth")) + val q: Q, + @Deprecated("Use eighteenth instead", ReplaceWith("eighteenth")) + val r: R, + @Deprecated("Use nineteenth instead", ReplaceWith("nineteenth")) + val s: S, + @Deprecated("Use twentieth instead", ReplaceWith("twentieth")) + val t: T, + @Deprecated("Use twentyFirst instead", ReplaceWith("twentyFirst")) + val u: U, + @Deprecated("Use twentySecond instead", ReplaceWith("twentySecond")) + val v: V +) : Tuple22Of { + val first: A = a + val second: B = b + val third: C = c + val fourth: D = d + val fifth: E = e + val sixth: F = f + val seventh: G = g + val eight: H = h + val ninth: I = i + val tenth: J = j + val eleventh: K = k + val twelfth: L = l + val thirteenth: M = m + val fourteenth: N = n + val fifteenth: O = o + val sixteenth: P = p + val seventeenth: Q = q + val eighteenth: R = r + val nineteenth: S = s + val twentyFirst: U = u + val twentySecond: V = v + companion object } diff --git a/arrow-core-data/src/main/kotlin/arrow/core/Validated.kt b/arrow-core-data/src/main/kotlin/arrow/core/Validated.kt index d5012504f..608b8fbf9 100644 --- a/arrow-core-data/src/main/kotlin/arrow/core/Validated.kt +++ b/arrow-core-data/src/main/kotlin/arrow/core/Validated.kt @@ -848,11 +848,19 @@ sealed class Validated : ValidatedOf { { a -> HR.run { a.hashWithSalt(salt.hashWithSalt(1)) } } ) - data class Valid(val a: A) : Validated() { + data class Valid( + @Deprecated("Use value instead", ReplaceWith("value")) + val a: A + ) : Validated() { + val value: A = a override fun toString(): String = "Validated.Valid($a)" } - data class Invalid(val e: E) : Validated() { + data class Invalid( + @Deprecated("Use value instead", ReplaceWith("value")) + val e: E + ) : Validated() { + val value: E = e override fun toString(): String = "Validated.Invalid($e)" }