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({ empty }, f)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a bit confused by these replacements. This won't result in correct code, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it won't work. I'm writing an entry in the arrow web migration guide just to explain this. It's the only way to get rid of the Monoid.empty deprecated method.

)
public fun <C> foldMap(MN: Monoid<C>, f: (B) -> C): C =
fold({ MN.empty() }, f)
Expand Down Expand Up @@ -2332,8 +2332,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 @@ -2543,7 +2542,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(empty) else this.map { b -> List(n) { b }.fold(empty){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>({ empty }, { 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("fold(initialValue, {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(empty) { 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
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({ empty }, f)")
)
public inline fun <B> foldMap(MB: Monoid<B>, f: (A) -> B): B =
fold({ MB.empty() }, f)
Expand Down Expand Up @@ -1312,11 +1312,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 @@ -1415,7 +1415,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(intialValue){a1, a2 -> a1 + a2} }")
franciscodr marked this conversation as resolved.
Show resolved Hide resolved
)
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 @@ -1633,7 +1633,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 @@ -758,17 +758,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({ initial }, f)")
)
public inline fun <B> foldMap(MB: Monoid<B>, f: (A) -> B): B =
fold({ MB.empty() }, f)
Expand Down Expand Up @@ -1036,14 +1036,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({ initial }, ::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({ initial }, ::identity)", "arrow.core.fold")
)
public fun <E, A> Validated<E, A>.combineAll(MA: Monoid<A>): A =
fold(MA)
Expand Down Expand Up @@ -1255,7 +1255,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 Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,8 @@ public inline fun <K, E, A, B> Map<K, A>.traverseValidated(
@Deprecated(
ValidatedDeprMsg + "Use the mapOrAccumulate API instead",
ReplaceWith(
"mapOrAccumulate<K, E, A, B>(semigroup::combine) { f(it.value).bind<B>() }.toValidated()",
"arrow.core.mapOrAccumulate",
"arrow.typeclasses.combine"
"this.mapOrAccumulate<K, E, A, B>({e1, e2 -> e1 + e2}) { f(it.value).bind<B>() }.toValidated()",
"arrow.core.mapOrAccumulate"
)
)
public inline fun <K, E, A, B> Map<K, A>.traverse(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,15 @@ public fun interface Semigroup<A> {
@JvmStatic
@Deprecated(
"$SemigroupDeprecation. Use Either::combine directly instead.",
ReplaceWith("{ a: Either<A, B>, b: Either<A, B> -> a.combine(b, SA::combine, SB::combine) }")
ReplaceWith("{ a: Either<A, B>, b: Either<A, B> -> a.combine(b, {a1, a2 -> a1 + a2}, {b1, b2 -> b1 + b2}) }")
)
public fun <A, B> either(SA: Semigroup<A>, SB: Semigroup<B>): Semigroup<Either<A, B>> =
EitherSemigroup(SA, SB)

@JvmStatic
@Deprecated(
"$SemigroupDeprecation. Use Ior::combine directly instead.",
ReplaceWith("{ a: Ior<A, B>, b: Ior<A, B> -> a.combine(b, SA::combine, SB::combine) }")
ReplaceWith("{ a: Ior<A, B>, b: Ior<A, B> -> a.combine(b, {a1, a2 -> a1 + a2}, {b1, b2 -> b1 + b2}) }")
)
public fun <A, B> ior(SA: Semigroup<A>, SB: Semigroup<B>): Semigroup<Ior<A, B>> =
IorSemigroup(SA, SB)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,8 +450,42 @@ class EitherTest : StringSpec({
}
}
}

"traverse should return list if either is right" {

"combine should combine 2 eithers" {
checkAll(Arb.either(Arb.string(), Arb.int()), Arb.either(Arb.string(), Arb.int())) { e1, e2 ->
val obtained = e1.combine(e2, { l1, l2 -> l1 + l2 }, { r1, r2 -> r1 + r2 })
val expected = when(e1){
is Left -> when(e2) {
is Left -> e1.value + e2.value
is Right -> e1
}
is Right -> when(e2) {
is Left -> e2
is Right -> e1.value + e2.value
}
}
obtained shouldBe expected
}
}


"combine should combine list of eithers " {
checkAll(Arb.list(Arb.either(Arb.string(), Arb.int()))) { list ->
val obtained = list.fold<Either<String, Int>, Either<String, Int>>(0.right()) { x, y ->
Either.zipOrAccumulate<String, Int, Int, Int>(
{ a1, a2 -> a1 + a2 },
x,
y,
{ b1, b2 -> b1 + b2 })
}
val expected = list[0]
obtained shouldBe expected
}
}



"traverse should return list if either is right" {
val right: Either<String, Int> = Right(1)
val left: Either<String, Int> = Left("foo")

Expand Down
9 changes: 7 additions & 2 deletions arrow-libs/optics/arrow-optics/api/arrow-optics.api
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ public final class arrow/optics/Fold$DefaultImpls {
public static fun firstOrNull (Larrow/optics/Fold;Ljava/lang/Object;)Ljava/lang/Object;
public static fun fold (Larrow/optics/Fold;Larrow/typeclasses/Monoid;Ljava/lang/Object;)Ljava/lang/Object;
public static fun fold (Larrow/optics/Fold;Ljava/lang/Object;Lkotlin/jvm/functions/Function2;Ljava/lang/Object;)Ljava/lang/Object;
public static fun foldMap (Larrow/optics/Fold;Ljava/lang/Object;Lkotlin/jvm/functions/Function2;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static fun getAll (Larrow/optics/Fold;Ljava/lang/Object;)Ljava/util/List;
public static fun isEmpty (Larrow/optics/Fold;Ljava/lang/Object;)Z
public static fun isNotEmpty (Larrow/optics/Fold;Ljava/lang/Object;)Z
Expand All @@ -105,6 +104,7 @@ public abstract interface class arrow/optics/Getter : arrow/optics/Fold {
public abstract fun compose (Larrow/optics/Getter;)Larrow/optics/Getter;
public abstract fun first ()Larrow/optics/Getter;
public abstract fun foldMap (Larrow/typeclasses/Monoid;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public abstract fun foldMap (Ljava/lang/Object;Lkotlin/jvm/functions/Function2;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public abstract fun get (Ljava/lang/Object;)Ljava/lang/Object;
public abstract fun left ()Larrow/optics/Getter;
public abstract fun plus (Larrow/optics/Getter;)Larrow/optics/Getter;
Expand Down Expand Up @@ -173,6 +173,7 @@ public abstract interface class arrow/optics/PEvery : arrow/optics/Fold, arrow/o
public abstract fun compose (Larrow/optics/PEvery;)Larrow/optics/PEvery;
public static fun either ()Larrow/optics/PEvery;
public abstract fun foldMap (Larrow/typeclasses/Monoid;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public abstract fun foldMap (Ljava/lang/Object;Lkotlin/jvm/functions/Function2;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public abstract fun getEvery (Larrow/optics/PIso;)Larrow/optics/PEvery;
public abstract fun getEvery (Larrow/optics/PLens;)Larrow/optics/PEvery;
public abstract fun getEvery (Larrow/optics/POptional;)Larrow/optics/PEvery;
Expand Down Expand Up @@ -234,7 +235,6 @@ public final class arrow/optics/PEvery$DefaultImpls {
public static fun firstOrNull (Larrow/optics/PEvery;Ljava/lang/Object;)Ljava/lang/Object;
public static fun fold (Larrow/optics/PEvery;Larrow/typeclasses/Monoid;Ljava/lang/Object;)Ljava/lang/Object;
public static fun fold (Larrow/optics/PEvery;Ljava/lang/Object;Lkotlin/jvm/functions/Function2;Ljava/lang/Object;)Ljava/lang/Object;
public static fun foldMap (Larrow/optics/PEvery;Ljava/lang/Object;Lkotlin/jvm/functions/Function2;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static fun getAll (Larrow/optics/PEvery;Ljava/lang/Object;)Ljava/util/List;
public static fun getEvery (Larrow/optics/PEvery;Larrow/optics/PEvery;)Larrow/optics/PTraversal;
public static fun getEvery (Larrow/optics/PEvery;Larrow/optics/PIso;)Larrow/optics/PEvery;
Expand Down Expand Up @@ -264,6 +264,7 @@ public abstract interface class arrow/optics/PIso : arrow/optics/Fold, arrow/opt
public static fun eitherToValidated ()Larrow/optics/PIso;
public abstract fun first ()Larrow/optics/PIso;
public abstract fun foldMap (Larrow/typeclasses/Monoid;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public abstract fun foldMap (Ljava/lang/Object;Lkotlin/jvm/functions/Function2;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public abstract fun get (Ljava/lang/Object;)Ljava/lang/Object;
public abstract fun getOrModify (Ljava/lang/Object;)Larrow/core/Either;
public abstract fun left ()Larrow/optics/PIso;
Expand Down Expand Up @@ -385,6 +386,7 @@ public abstract interface class arrow/optics/PLens : arrow/optics/Getter, arrow/
public abstract fun compose (Larrow/optics/PLens;)Larrow/optics/PLens;
public abstract fun first ()Larrow/optics/PLens;
public abstract fun foldMap (Larrow/typeclasses/Monoid;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public abstract fun foldMap (Ljava/lang/Object;Lkotlin/jvm/functions/Function2;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public abstract fun get (Ljava/lang/Object;)Ljava/lang/Object;
public abstract fun getOrModify (Ljava/lang/Object;)Larrow/core/Either;
public static fun nonEmptyListHead ()Larrow/optics/PLens;
Expand Down Expand Up @@ -490,6 +492,7 @@ public abstract interface class arrow/optics/POptional : arrow/optics/PEvery, ar
public abstract fun compose (Larrow/optics/POptional;)Larrow/optics/POptional;
public abstract fun first ()Larrow/optics/POptional;
public abstract fun foldMap (Larrow/typeclasses/Monoid;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public abstract fun foldMap (Ljava/lang/Object;Lkotlin/jvm/functions/Function2;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public abstract fun getOrModify (Ljava/lang/Object;)Larrow/core/Either;
public static fun listHead ()Larrow/optics/POptional;
public static fun listTail ()Larrow/optics/POptional;
Expand Down Expand Up @@ -570,6 +573,7 @@ public abstract interface class arrow/optics/POptionalGetter : arrow/optics/Fold
public static fun filter (Lkotlin/jvm/functions/Function1;)Larrow/optics/POptionalGetter;
public abstract fun first ()Larrow/optics/POptionalGetter;
public abstract fun foldMap (Larrow/typeclasses/Monoid;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public abstract fun foldMap (Ljava/lang/Object;Lkotlin/jvm/functions/Function2;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public abstract fun getOrModify (Ljava/lang/Object;)Larrow/core/Either;
public abstract fun getOrNull (Ljava/lang/Object;)Ljava/lang/Object;
public abstract fun plus (Larrow/optics/POptionalGetter;)Larrow/optics/POptionalGetter;
Expand Down Expand Up @@ -618,6 +622,7 @@ public abstract interface class arrow/optics/PPrism : arrow/optics/PEvery, arrow
public static fun eitherRight ()Larrow/optics/PPrism;
public abstract fun first ()Larrow/optics/PPrism;
public abstract fun foldMap (Larrow/typeclasses/Monoid;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public abstract fun foldMap (Ljava/lang/Object;Lkotlin/jvm/functions/Function2;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public abstract fun getOrModify (Ljava/lang/Object;)Larrow/core/Either;
public abstract fun left ()Larrow/optics/PPrism;
public abstract fun liftNullable (Lkotlin/jvm/functions/Function1;)Lkotlin/jvm/functions/Function1;
Expand Down
Loading