Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Monoid and Semigroup combine from replacements #3003

Merged
merged 10 commits into from
Mar 30, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ public sealed class Either<out A, out B> {

@Deprecated(
NicheAPI + "Prefer when or fold instead",
ReplaceWith(" fold({ MN.empty() }, f)")
ReplaceWith("fold({ ifLeft }, f)")
)
public fun <C> foldMap(MN: Monoid<C>, f: (B) -> C): C =
fold({ MN.empty() }, f)
Expand Down Expand Up @@ -2341,8 +2341,7 @@ public fun <A, B> Either<A, B>.combine(SGA: Semigroup<A>, SGB: Semigroup<B>, b:
@Deprecated(
MonoidDeprecation,
ReplaceWith(
"fold<Either<A, B>, Either<A, B>>(MB.empty().right()) { x, y -> Either.zipOrAccumulate(MA::combine, x, y, MB::combine) }",
"arrow.typeclasses.combine"
"this.fold<Either<A, B>, Either<A, B>>(initialValue.right()) { x, y -> Either.zipOrAccumulate<A, B, B, B>({a1, a2 -> a1 + a2}, x, y, {b1, b2 -> b1 + b2}) }"
)
)
public fun <A, B> Iterable<Either<A, B>>.combineAll(MA: Monoid<A>, MB: Monoid<B>): Either<A, B> =
Expand Down Expand Up @@ -2552,7 +2551,7 @@ public inline fun <A, B, C, D, E, F, G, H, I, J, K, L> Either<A, B>.zip(

@Deprecated(
NicheAPI + "Prefer using the Either DSL, or map",
ReplaceWith("if (n <= 0) Either.Right(MB.empty()) else map { b -> List(n) { b }.fold(MB) }")
ReplaceWith("if (n <= 0) Either.Right(initial) else this.map { b -> List(n) { b }.fold(initial){r, t -> r + t} }")
)
public fun <A, B> Either<A, B>.replicate(n: Int, MB: Monoid<B>): Either<A, B> =
map { b -> List(n) { b }.fold(MB.empty(), MB::combine) }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ public sealed class Ior<out A, out B> {

@Deprecated(
NicheAPI + "Prefer when or fold instead",
ReplaceWith("this.fold<C>({ MN.empty() }, { f }, { _, b -> f(b) })")
ReplaceWith("this.fold<C>({ leftValue }, { f }, { _, b -> f(b) })")
)
public inline fun <C> foldMap(MN: Monoid<C>, f: (B) -> C): C {
contract { callsInPlace(f, InvocationKind.AT_MOST_ONCE) }
Expand Down Expand Up @@ -911,7 +911,7 @@ public sealed class Ior<out A, out B> {

@Deprecated(
"$SemigroupDeprecation.",
ReplaceWith("flatMap(SA::combine, f)", "arrow.typeclasses.combine")
ReplaceWith("this.flatMap({a, b -> a + b}, f)")
)
public inline fun <A, B, D> Ior<A, B>.flatMap(SG: Semigroup<A>, f: (B) -> Ior<A, D>): Ior<A, D> =
flatMap(SG::combine, f)
Expand Down Expand Up @@ -1011,7 +1011,7 @@ public fun <A, B, C> Ior<Validated<A, B>, Validated<A, C>>.bisequenceValidated(S

@Deprecated(
"$SemigroupDeprecation",
ReplaceWith("combine(other, SA::combine, SB::combine)", "arrow.typeclasses.combine")
ReplaceWith("combine(other, {a1, a2 -> a1 + a2}, {b1, b2 -> b1 + b2} )")
)
public fun <A, B> Ior<A, B>.combine(SA: Semigroup<A>, SB: Semigroup<B>, other: Ior<A, B>): Ior<A, B> =
combine(other, SA::combine, SB::combine)
Expand Down Expand Up @@ -1043,7 +1043,7 @@ public inline fun <A, B> Ior<A, Ior<A, B>>.flatten(combine: (A, A) -> A): Ior<A,
@Suppress("NOTHING_TO_INLINE")
@Deprecated(
"$SemigroupDeprecation.",
ReplaceWith("flatten(SA::combine)", "arrow.typeclasses.combine")
ReplaceWith("this.flatten{a1, a2 -> a1 + a2}")
)
public inline fun <A, B> Ior<A, Ior<A, B>>.flatten(SA: Semigroup<A>): Ior<A, B> =
flatMap(SA, ::identity)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,7 @@ public fun <A, B> Iterable<A>.align(b: Iterable<B>): List<Ior<A, B>> =
/**
* aligns two structures and combine them with the given [Semigroup.combine]
*/
@Deprecated(SemigroupDeprecation, ReplaceWith("padZip(other, { it }, { it }, SG::combine)", "arrow.typeclasses.combine"))
@Deprecated(SemigroupDeprecation, ReplaceWith("this.padZip<A, A, A>(other, { it }, { it }, {a1, a2 -> a1 + a2})"))
public fun <A> Iterable<A>.salign(
SG: Semigroup<A>,
other: Iterable<A>
Expand Down Expand Up @@ -928,7 +928,7 @@ public fun <A, B> Iterable<Ior<A, B>>.unalign(): Pair<List<A>, List<B>> = separa
public inline fun <A, B, C> Iterable<C>.unalign(fa: (C) -> Ior<A, B>): Pair<List<A>, List<B>> =
map(fa).unalign()

@Deprecated("Use fold from Kotlin Std instead", ReplaceWith("fold(MA.empty(), MA::combine)", "arrow.typeclasses.combine"))
@Deprecated("Use fold from Kotlin Std instead", ReplaceWith("this.fold(initial){a1, a2 -> a1 + a2}"))
public fun <A> Iterable<A>.combineAll(MA: Monoid<A>): A =
fold(MA.empty(), MA::combine)

Expand Down Expand Up @@ -1235,11 +1235,11 @@ public fun <B, A : B> Iterable<A>.widen(): Iterable<B> =
public fun <B, A : B> List<A>.widen(): List<B> =
this

@Deprecated(MonoidDeprecation, ReplaceWith("fold(MA.empty(), MA::combine)", "arrow.typeclasses.combine"))
@Deprecated(MonoidDeprecation, ReplaceWith("this.fold(initial, {a1, a2 -> a1 + a2})"))
public fun <A> Iterable<A>.fold(MA: Monoid<A>): A =
fold(MA.empty(), MA::combine)

@Deprecated(MonoidDeprecation, ReplaceWith("fold(MB.empty()) { acc, a -> MB.run { acc.combine(f(a)) } }"))
@Deprecated(MonoidDeprecation, ReplaceWith("this.fold(initial) { acc, a -> combine(acc, f(a)) }"))
public fun <A, B> Iterable<A>.foldMap(MB: Monoid<B>, f: (A) -> B): B =
fold(MB.empty()) { acc, a -> MB.run { acc.combine(f(a)) } }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public class NonEmptyList<out A>(
public fun <B> align(b: NonEmptyList<B>): NonEmptyList<Ior<A, B>> =
NonEmptyList(Ior.Both(head, b.head), tail.align(b.tail))

@Deprecated(SemigroupDeprecation, ReplaceWith("padZip(b, ::identity, ::identity, SA::combine)", "arrow.typeclasses.combine"))
@Deprecated(SemigroupDeprecation, ReplaceWith("padZip(b, ::identity, ::identity, {a1, a2 -> a1 + a2})"))
public fun salign(SA: Semigroup<@UnsafeVariance A>, b: NonEmptyList<@UnsafeVariance A>): NonEmptyList<A> =
padZip(b, ::identity, ::identity, SA::combine)

Expand Down Expand Up @@ -481,7 +481,7 @@ public inline fun <E, A, B> NonEmptyList<A>.traverse(
@Deprecated(
ValidatedDeprMsg + "Use the mapOrAccumulate API instead",
ReplaceWith(
"this.mapOrAccumulate<E, A>({ a, b -> a + b }) { it.bind<A>() }.toValidated()",
"this.mapOrAccumulate<E, A>({ e1, e2 -> e1 + e2 }) { it.bind<A>() }.toValidated()",
"arrow.core.mapOrAccumulate"
)
)
Expand All @@ -491,7 +491,7 @@ public fun <E, A> NonEmptyList<Validated<E, A>>.sequenceValidated(semigroup: Sem
@Deprecated(
ValidatedDeprMsg + "Use the mapOrAccumulate API instead",
ReplaceWith(
"this.mapOrAccumulate<E, A>({ a, b -> a + b }) { it.bind<A>() }.toValidated()",
"this.mapOrAccumulate<E, A>({ e1, e2 -> e1 + e2 }) { it.bind<A>() }.toValidated()",
"arrow.core.mapOrAccumulate"
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,7 @@ public sealed class Option<out A> {

@Deprecated(
NicheAPI + "Prefer when or fold instead",
ReplaceWith("fold({ MB.empty() }, f)")
ReplaceWith("fold({ ifEmpty }, f)")
)
public inline fun <B> foldMap(MB: Monoid<B>, f: (A) -> B): B =
fold({ MB.empty() }, f)
Expand Down Expand Up @@ -1314,11 +1314,11 @@ public fun <A> A.some(): Option<A> = Some(this)

public fun <A> none(): Option<A> = None

@Deprecated(SemigroupDeprecation, ReplaceWith("fold(none<A>()) { x, y -> x.combine(y, MA::combine) }", "arrow.typeclasses.combine"))
@Deprecated(SemigroupDeprecation, ReplaceWith("fold(none<A>()) { x, y -> x.combine(y){a1, a2 -> a1 + a2} }"))
public fun <A> Iterable<Option<A>>.combineAll(MA: Monoid<A>): Option<A> =
fold(none<A>()) { x, y -> x.combine(y, MA::combine) }

@Deprecated("use getOrElse instead", ReplaceWith("getOrElse { MA.empty() }"))
@Deprecated("use getOrElse instead", ReplaceWith("getOrElse { empty }"))
public fun <A> Option<A>.combineAll(MA: Monoid<A>): A =
getOrElse { MA.empty() }

Expand Down Expand Up @@ -1417,7 +1417,7 @@ public inline fun <A, B> Option<A>.redeemWith(fe: (Unit) -> Option<B>, fb: (A) -

@Deprecated(
NicheAPI + "Prefer using the Option DSL or map",
ReplaceWith("map { a -> List(n) { a }.fold(MA.empty(), MA::combine) }", "arrow.typeclasses.combine")
ReplaceWith("this.map { a -> List(n) { a }.fold(initial){a1, a2 -> a1 + a2} }")
)
public fun <A> Option<A>.replicate(n: Int, MA: Monoid<A>): Option<A> =
map { a -> List(n) { a }.fold(MA.empty(), MA::combine) }
Expand Down Expand Up @@ -1635,7 +1635,7 @@ public fun <A> Option<A>.combine(other: Option<A>, combine: (A, A) -> A): Option
None -> other
}

@Deprecated(SemigroupDeprecation, ReplaceWith("combine(b, SGA::combine)", "arrow.typeclasses.combine"))
@Deprecated(SemigroupDeprecation, ReplaceWith("this.combine<A>(b){a1, a2 -> a1 + a2}"))
public fun <A> Option<A>.combine(SGA: Semigroup<A>, b: Option<A>): Option<A> =
combine(b, SGA::combine)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ public fun <A> Sequence<A>.fold(MA: Monoid<A>): A = MA.run {

@Deprecated(
"$MonoidDeprecation\n$NicheAPI",
ReplaceWith("fold(initial){ acc, a -> acc, f(a) } }", "arrow.core.sequence")
ReplaceWith("this.fold(initial){ acc, a -> acc + f(a) }")
)
public fun <A, B> Sequence<A>.foldMap(MB: Monoid<B>, f: (A) -> B): B = MB.run {
this@foldMap.fold(empty()) { acc, a ->
Expand Down Expand Up @@ -757,17 +757,16 @@ public fun <A> Sequence<Option<A>>.sequenceOption(): Option<Sequence<A>> =
@Deprecated(
ValidatedDeprMsg + "Use the mapOrAccumulate API instead",
ReplaceWith(
"mapOrAccumulate(semigroup::combine) { it.bind() }.toValidated()",
"arrow.core.mapOrAccumulate",
"arrow.typeclasses.combine"
"this.mapOrAccumulate<Nel<A>, Validated<E, A>, A>({e1, e2 -> e1 + e1}) { it.bind() }.toValidated()",
"arrow.core.mapOrAccumulate"
)
)
public fun <E, A> Sequence<Validated<E, A>>.sequence(semigroup: Semigroup<E>): Validated<E, List<A>> =
mapOrAccumulate(semigroup::combine) { it.bind() }.toValidated()

@Deprecated(
"sequenceValidated is being renamed to sequence to simplify the Arrow API",
ReplaceWith("sequence(semigroup).map { it.asSequence() }", "arrow.core.sequence")
ReplaceWith("this.mapOrAccumulate<Nel<A>, Validated<E, A>, A>({e1, e2 -> e1 + e1}) { it.bind() }.toValidated().map { it.asSequence() }", "arrow.core.mapOrAccumulate")
)
public fun <E, A> Sequence<Validated<E, A>>.sequenceValidated(semigroup: Semigroup<E>): Validated<E, Sequence<A>> =
sequence(semigroup).map { it.asSequence() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public sealed class Validated<out E, out A> {

@Deprecated(
ValidatedDeprMsg + "Use fold on Either after refactoring instead",
ReplaceWith("toEither().fold({ MB.empty() }, f)")
ReplaceWith("toEither().fold({ invalidValue }, f)")
)
public inline fun <B> foldMap(MB: Monoid<B>, f: (A) -> B): B =
fold({ MB.empty() }, f)
Expand Down Expand Up @@ -564,9 +564,8 @@ public sealed class Validated<out E, out A> {
@Deprecated(
ValidatedDeprMsg + "zipOrAccumulate for Either now exposes this same functionality",
ReplaceWith(
"Either.zipOrAccumulate(SE::combine, toEither(), fb.toEither(), ::Pair).toValidated()",
"arrow.core.Either",
"arrow.typeclasses.combine"
"Either.zipOrAccumulate({ e1, e2 -> e1 + e2 }, toEither(), fb.toEither(), ::Pair).toValidated()",
"arrow.core.Either"
)
)
public fun <E, A, B> Validated<E, A>.zip(SE: Semigroup<E>, fb: Validated<E, B>): Validated<E, Pair<A, B>> =
Expand All @@ -575,9 +574,8 @@ public fun <E, A, B> Validated<E, A>.zip(SE: Semigroup<E>, fb: Validated<E, B>):
@Deprecated(
ValidatedDeprMsg + "zipOrAccumulate for Either now exposes this same functionality",
ReplaceWith(
"Either.zipOrAccumulate(SE::combine, toEither(), b.toEither(), f).toValidated()",
"arrow.core.Either",
"arrow.typeclasses.combine"
"Either.zipOrAccumulate({ e1, e2 -> e1 + e2 }, toEither(), b.toEither(), f).toValidated()",
"arrow.core.Either"
)
)
public inline fun <E, A, B, Z> Validated<E, A>.zip(
Expand All @@ -590,9 +588,8 @@ public inline fun <E, A, B, Z> Validated<E, A>.zip(
@Deprecated(
ValidatedDeprMsg + "zipOrAccumulate for Either now exposes this same functionality",
ReplaceWith(
"Either.zipOrAccumulate(SE::combine, toEither(), b.toEither(), c.toEither(), f).toValidated()",
"arrow.core.Either",
"arrow.typeclasses.combine"
"Either.zipOrAccumulate({ e1, e2 -> e1 + e2 }, toEither(), b.toEither(), c.toEither(), f).toValidated()",
"arrow.core.Either"
)
)
public inline fun <E, A, B, C, Z> Validated<E, A>.zip(
Expand All @@ -606,9 +603,8 @@ public inline fun <E, A, B, C, Z> Validated<E, A>.zip(
@Deprecated(
ValidatedDeprMsg + "zipOrAccumulate for Either now exposes this same functionality",
ReplaceWith(
"Either.zipOrAccumulate(SE::combine, toEither(), b.toEither(), c.toEither(), d.toEither(), f).toValidated()",
"arrow.core.Either",
"arrow.typeclasses.combine"
"Either.zipOrAccumulate({ e1, e2 -> e1 + e2 }, toEither(), b.toEither(), c.toEither(), d.toEither(), f).toValidated()",
"arrow.core.Either"
)
)
public inline fun <E, A, B, C, D, Z> Validated<E, A>.zip(
Expand All @@ -623,9 +619,8 @@ public inline fun <E, A, B, C, D, Z> Validated<E, A>.zip(
@Deprecated(
ValidatedDeprMsg + "zipOrAccumulate for Either now exposes this same functionality",
ReplaceWith(
"Either.zipOrAccumulate(SE::combine, toEither(), b.toEither(), c.toEither(), d.toEither(), e.toEither(), f).toValidated()",
"arrow.core.Either",
"arrow.typeclasses.combine"
"Either.zipOrAccumulate({ e1, e2 -> e1 + e2 }, toEither(), b.toEither(), c.toEither(), d.toEither(), e.toEither(), f).toValidated()",
"arrow.core.Either"
)
)
public inline fun <E, A, B, C, D, EE, Z> Validated<E, A>.zip(
Expand All @@ -642,9 +637,8 @@ public inline fun <E, A, B, C, D, EE, Z> Validated<E, A>.zip(
@Deprecated(
ValidatedDeprMsg + "zipOrAccumulate for Either now exposes this same functionality",
ReplaceWith(
"Either.zipOrAccumulate(SE::combine, toEither(), b.toEither(), c.toEither(), d.toEither(), e.toEither(), ff.toEither(), f).toValidated()",
"arrow.core.Either",
"arrow.typeclasses.combine"
"Either.zipOrAccumulate({ e1, e2 -> e1 + e2 }, toEither(), b.toEither(), c.toEither(), d.toEither(), e.toEither(), ff.toEither(), f).toValidated()",
"arrow.core.Either"
)
)
public inline fun <E, A, B, C, D, EE, FF, Z> Validated<E, A>.zip(
Expand All @@ -670,9 +664,8 @@ public inline fun <E, A, B, C, D, EE, FF, Z> Validated<E, A>.zip(
@Deprecated(
ValidatedDeprMsg + "zipOrAccumulate for Either now exposes this same functionality",
ReplaceWith(
"Either.zipOrAccumulate(SE::combine, toEither(), b.toEither(), c.toEither(), d.toEither(), e.toEither(), ff.toEither(), g.toEither(), f).toValidated()",
"arrow.core.Either",
"arrow.typeclasses.combine"
"Either.zipOrAccumulate({ e1, e2 -> e1 + e2 }, toEither(), b.toEither(), c.toEither(), d.toEither(), e.toEither(), ff.toEither(), g.toEither(), f).toValidated()",
"arrow.core.Either"
)
)
public inline fun <E, A, B, C, D, EE, F, G, Z> Validated<E, A>.zip(
Expand Down Expand Up @@ -700,9 +693,8 @@ public inline fun <E, A, B, C, D, EE, F, G, Z> Validated<E, A>.zip(
@Deprecated(
ValidatedDeprMsg + "zipOrAccumulate for Either now exposes this same functionality",
ReplaceWith(
"Either.zipOrAccumulate(SE::combine, toEither(), b.toEither(), c.toEither(), d.toEither(), e.toEither(), ff.toEither(), g.toEither(), h.toEither(), f).toValidated()",
"arrow.core.Either",
"arrow.typeclasses.combine"
"Either.zipOrAccumulate({ e1, e2 -> e1 + e2 }, toEither(), b.toEither(), c.toEither(), d.toEither(), e.toEither(), ff.toEither(), g.toEither(), h.toEither(), f).toValidated()",
"arrow.core.Either"
)
)
public inline fun <E, A, B, C, D, EE, F, G, H, Z> Validated<E, A>.zip(
Expand Down Expand Up @@ -732,9 +724,8 @@ public inline fun <E, A, B, C, D, EE, F, G, H, Z> Validated<E, A>.zip(
@Deprecated(
ValidatedDeprMsg + "zipOrAccumulate for Either now exposes this same functionality",
ReplaceWith(
"Either.zipOrAccumulate(SE::combine, toEither(), b.toEither(), c.toEither(), d.toEither(), e.toEither(), ff.toEither(), g.toEither(), h.toEither(), i.toEither(), f).toValidated()",
"arrow.core.Either",
"arrow.typeclasses.combine"
"Either.zipOrAccumulate({ e1, e2 -> e1 + e2 }, toEither(), b.toEither(), c.toEither(), d.toEither(), e.toEither(), ff.toEither(), g.toEither(), h.toEither(), i.toEither(), f).toValidated()",
"arrow.core.Either"
)
)
public inline fun <E, A, B, C, D, EE, F, G, H, I, Z> Validated<E, A>.zip(
Expand Down Expand Up @@ -766,9 +757,8 @@ public inline fun <E, A, B, C, D, EE, F, G, H, I, Z> Validated<E, A>.zip(
@Deprecated(
ValidatedDeprMsg + "zipOrAccumulate for Either now exposes this same functionality",
ReplaceWith(
"Either.zipOrAccumulate(SE::combine, toEither(), b.toEither(), c.toEither(), d.toEither(), e.toEither(), ff.toEither(), g.toEither(), h.toEither(), i.toEither(), j.toEither(), f).toValidated()",
"arrow.core.Either",
"arrow.typeclasses.combine"
"Either.zipOrAccumulate({ e1, e2 -> e1 + e2 }, toEither(), b.toEither(), c.toEither(), d.toEither(), e.toEither(), ff.toEither(), g.toEither(), h.toEither(), i.toEither(), j.toEither(), f).toValidated()",
"arrow.core.Either"
)
)
public inline fun <E, A, B, C, D, EE, F, G, H, I, J, Z> Validated<E, A>.zip(
Expand Down Expand Up @@ -986,8 +976,7 @@ public fun <EE, E : EE, A> Validated<E, A>.leftWiden(): Validated<EE, A> =
@Deprecated(
DeprAndNicheMsg + "Prefer using the Either DSL, or map",
ReplaceWith(
"(0 until (n.coerceAtLeast(0))).mapOrAccumulate(SE::combine) { bind() }.toValidated()",
"arrow.typeclasses.combine"
"(0 until (n.coerceAtLeast(0))).mapOrAccumulate({ e1, e2 -> e1 + e2 }) { bind() }.toValidated()"
)
)
public fun <E, A> Validated<E, A>.replicate(SE: Semigroup<E>, n: Int): Validated<E, List<A>> =
Expand Down Expand Up @@ -1041,14 +1030,14 @@ public fun <A, B> Validated<A?, B?>.bisequenceNullable(): Validated<A, B>? =

@Deprecated(
"$MonoidDeprecation\n$DeprAndNicheMsg\nUse fold on Either after refactoring",
ReplaceWith("fold({ MA.empty() }, ::identity)")
ReplaceWith("fold({ invalidValue }, ::identity)")
)
public fun <E, A> Validated<E, A>.fold(MA: Monoid<A>): A =
fold({ MA.empty() }, ::identity)

@Deprecated(
"$MonoidDeprecation\n$DeprAndNicheMsg\nUse fold on Either after refactoring",
ReplaceWith("fold({ MA.empty() }, ::identity)", "arrow.core.fold")
ReplaceWith("fold({ invalidValue }, ::identity)", "arrow.core.fold")
)
public fun <E, A> Validated<E, A>.combineAll(MA: Monoid<A>): A =
fold(MA)
Expand Down Expand Up @@ -1165,9 +1154,8 @@ public inline fun <E, A> Validated<E, A>.valueOr(f: (E) -> A): A =
@Deprecated(
DeprAndNicheMsg + "Use recover on Either after refactoring",
ReplaceWith(
"toEither().recover { e -> that().mapLeft { ee -> SE.combine(e, ee) }.bind() }.toValidated()",
"arrow.core.recover",
"arrow.typeclasses.combine"
"toEither().recover { e -> that().mapLeft { ee -> e + ee }.bind() }.toValidated()",
"arrow.core.recover"
)
)
public inline fun <E, A> Validated<E, A>.findValid(SE: Semigroup<E>, that: () -> Validated<E, A>): Validated<E, A> =
Expand Down Expand Up @@ -1260,7 +1248,7 @@ public inline fun <A> Validated<A, A>.merge(): A =

@Deprecated(
ValidatedDeprMsg + "Use Either.zipOrAccumulate instead",
ReplaceWith("Either.zipOrAccumulate(SE::combine, toEither(), y.toEither(), SA::combine).toValidated()")
ReplaceWith("Either.zipOrAccumulate({e1, e2 -> e1 + e2}, this.toEither(), y.toEither(), {a1, a2 -> a1 + a2} ).toValidated()")
)
public fun <E, A> Validated<E, A>.combine(
SE: Semigroup<E>,
Expand All @@ -1272,9 +1260,8 @@ public fun <E, A> Validated<E, A>.combine(
@Deprecated(
DeprAndNicheMsg,
ReplaceWith(
"toEither().recover { e -> y.toEither().recover { ee -> raise(SE.combine(e, ee)) }.bind() }.toValidated()",
"arrow.core.recover",
"arrow.typeclasses.combine"
"toEither().recover { e -> y.toEither().recover { ee -> raise { e + ee }} }.bind() }.toValidated()",
"arrow.core.recover"
)
)
public fun <E, A> Validated<E, A>.combineK(SE: Semigroup<E>, y: Validated<E, A>): Validated<E, A> =
Expand Down
Loading