Skip to content

Commit

Permalink
[PROPOSAL] Either API deprecation, and preparation for 2.x.x (#2830)
Browse files Browse the repository at this point in the history
Co-authored-by: Imran Malic Settuba <[email protected]>
Co-authored-by: Alejandro Serrano <[email protected]>
  • Loading branch information
3 people authored Nov 17, 2022
1 parent a9c8dcc commit cf0add9
Show file tree
Hide file tree
Showing 32 changed files with 1,024 additions and 476 deletions.
45 changes: 44 additions & 1 deletion arrow-libs/core/arrow-core/api/arrow-core.api
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,18 @@ public final class arrow/core/Currying {
public static final fun uncurriedEffect (Lkotlin/jvm/functions/Function1;)Lkotlin/jvm/functions/Function9;
}

public final class arrow/core/DefaultRecoverEffect : arrow/core/continuations/Token, arrow/core/RecoverEffect {
public fun <init> ()V
public fun bind (Larrow/core/Either;)Ljava/lang/Object;
public fun bind (Larrow/core/Option;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
public fun bind (Larrow/core/Validated;)Ljava/lang/Object;
public fun bind (Larrow/core/continuations/EagerEffect;)Ljava/lang/Object;
public fun bind (Larrow/core/continuations/Effect;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun bind (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public fun ensure (ZLkotlin/jvm/functions/Function0;)V
public fun shift (Ljava/lang/Object;)Ljava/lang/Object;
}

public abstract class arrow/core/Either {
public static final field Companion Larrow/core/Either$Companion;
public final fun all (Lkotlin/jvm/functions/Function1;)Z
Expand All @@ -166,6 +178,8 @@ public abstract class arrow/core/Either {
public final fun foldLeft (Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)Ljava/lang/Object;
public final fun foldMap (Larrow/typeclasses/Monoid;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun fromNullable (Ljava/lang/Object;)Larrow/core/Either;
public final fun getOrNone ()Larrow/core/Option;
public final fun getOrNull ()Ljava/lang/Object;
public final fun isEmpty ()Z
public final fun isLeft ()Z
public final fun isNotEmpty ()Z
Expand All @@ -174,6 +188,8 @@ public abstract class arrow/core/Either {
public static final fun lift (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Lkotlin/jvm/functions/Function1;
public final fun map (Lkotlin/jvm/functions/Function1;)Larrow/core/Either;
public final fun mapLeft (Lkotlin/jvm/functions/Function1;)Larrow/core/Either;
public final fun onLeft (Lkotlin/jvm/functions/Function1;)Larrow/core/Either;
public final fun onRight (Lkotlin/jvm/functions/Function1;)Larrow/core/Either;
public final fun orNone ()Larrow/core/Option;
public final fun orNull ()Ljava/lang/Object;
public final fun replicate (I)Larrow/core/Either;
Expand Down Expand Up @@ -240,21 +256,26 @@ public final class arrow/core/Either$Right$Companion {
}

public final class arrow/core/EitherKt {
public static final field NicheAPI Ljava/lang/String;
public static final field RedundantAPI Ljava/lang/String;
public static final fun bisequence (Larrow/core/Either;)Ljava/util/List;
public static final fun bisequenceNullable (Larrow/core/Either;)Larrow/core/Either;
public static final fun bisequenceOption (Larrow/core/Either;)Larrow/core/Option;
public static final fun bisequenceValidated (Larrow/core/Either;)Larrow/core/Validated;
public static final fun catch (Larrow/core/Either;Lkotlin/jvm/functions/Function2;)Larrow/core/Either;
public static final fun combine (Larrow/core/Either;Larrow/typeclasses/Semigroup;Larrow/typeclasses/Semigroup;Larrow/core/Either;)Larrow/core/Either;
public static final fun combineAll (Ljava/lang/Iterable;Larrow/typeclasses/Monoid;Larrow/typeclasses/Monoid;)Larrow/core/Either;
public static final fun combineK (Larrow/core/Either;Larrow/core/Either;)Larrow/core/Either;
public static final fun compareTo (Larrow/core/Either;Larrow/core/Either;)I
public static final fun contains (Larrow/core/Either;Ljava/lang/Object;)Z
public static final fun ensure (Larrow/core/Either;Lkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function1;)Larrow/core/Either;
public static final fun ensureNotNull (Larrow/core/RecoverEffect;Ljava/lang/Object;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
public static final fun filterOrElse (Larrow/core/Either;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function0;)Larrow/core/Either;
public static final fun filterOrOther (Larrow/core/Either;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Larrow/core/Either;
public static final fun flatMap (Larrow/core/Either;Lkotlin/jvm/functions/Function1;)Larrow/core/Either;
public static final fun flatten (Larrow/core/Either;)Larrow/core/Either;
public static final fun getOrElse (Larrow/core/Either;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
public static final synthetic fun getOrElse (Larrow/core/Either;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
public static final fun getOrElse (Larrow/core/Either;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun getOrHandle (Larrow/core/Either;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static final fun handleError (Larrow/core/Either;Lkotlin/jvm/functions/Function1;)Larrow/core/Either;
public static final fun handleErrorWith (Larrow/core/Either;Lkotlin/jvm/functions/Function1;)Larrow/core/Either;
Expand All @@ -263,6 +284,7 @@ public final class arrow/core/EitherKt {
public static final fun leftWiden (Larrow/core/Either;)Larrow/core/Either;
public static final fun merge (Larrow/core/Either;)Ljava/lang/Object;
public static final fun orNull (Larrow/core/Either;)Ljava/lang/Object;
public static final fun recover (Larrow/core/Either;Lkotlin/jvm/functions/Function2;)Larrow/core/Either;
public static final fun redeem (Larrow/core/Either;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Larrow/core/Either;
public static final fun redeemWith (Larrow/core/Either;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Larrow/core/Either;
public static final fun replicate (Larrow/core/Either;ILarrow/typeclasses/Monoid;)Larrow/core/Either;
Expand Down Expand Up @@ -1421,6 +1443,27 @@ public final class arrow/core/PredefKt {
public static final fun identity (Ljava/lang/Object;)Ljava/lang/Object;
}

public abstract interface class arrow/core/RecoverEffect {
public abstract fun bind (Larrow/core/Either;)Ljava/lang/Object;
public abstract fun bind (Larrow/core/Option;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
public abstract fun bind (Larrow/core/Validated;)Ljava/lang/Object;
public abstract fun bind (Larrow/core/continuations/EagerEffect;)Ljava/lang/Object;
public abstract fun bind (Larrow/core/continuations/Effect;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun bind (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public abstract fun ensure (ZLkotlin/jvm/functions/Function0;)V
public abstract fun shift (Ljava/lang/Object;)Ljava/lang/Object;
}

public final class arrow/core/RecoverEffect$DefaultImpls {
public static fun bind (Larrow/core/RecoverEffect;Larrow/core/Either;)Ljava/lang/Object;
public static fun bind (Larrow/core/RecoverEffect;Larrow/core/Option;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
public static fun bind (Larrow/core/RecoverEffect;Larrow/core/Validated;)Ljava/lang/Object;
public static fun bind (Larrow/core/RecoverEffect;Larrow/core/continuations/EagerEffect;)Ljava/lang/Object;
public static fun bind (Larrow/core/RecoverEffect;Larrow/core/continuations/Effect;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static fun bind (Larrow/core/RecoverEffect;Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
public static fun ensure (Larrow/core/RecoverEffect;ZLkotlin/jvm/functions/Function0;)V
}

public final class arrow/core/ResultKt {
public static final fun composeErrors ([Ljava/lang/Throwable;)Ljava/lang/Throwable;
public static final fun flatMap (Ljava/lang/Object;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
Expand Down
3 changes: 2 additions & 1 deletion arrow-libs/core/arrow-core/knit.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ knit.package=arrow.core.examples
knit.dir=src/jvmTest/kotlin/examples/

test.package=arrow.core.examples.test
test.dir=src/jvmTest/kotlin/examples/autogenerated/
test.dir=src/jvmTest/kotlin/examples/test/
test.template=knit.test.template
15 changes: 15 additions & 0 deletions arrow-libs/core/arrow-core/knit.test.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// This file was automatically generated from ${file.name} by Knit tool. Do not edit.
package ${test.package}

import io.kotest.core.spec.style.StringSpec

class ${test.name} : StringSpec({
<#list cases as case>
"${case.name}" {
${case.knit.package}.${case.knit.name}.test()
}

</#list>
}) {
override fun timeout(): Long = 1000
}
Loading

0 comments on commit cf0add9

Please sign in to comment.