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

Fixes merge conflict between main and arrow-2 #2835

Merged
merged 12 commits into from
Oct 5, 2022
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import retrofit2.Converter
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import retrofit2.converter.moshi.MoshiConverterFactory
import java.net.ConnectException
import java.net.SocketException
import java.net.SocketTimeoutException

@ExperimentalSerializationApi
Expand Down Expand Up @@ -96,7 +96,7 @@ private fun networkEitherCallAdapterTests(

body.shouldBeInstanceOf<Left<*>>()
.value.shouldBeInstanceOf<IOError>()
.cause.shouldBeInstanceOf<ConnectException>()
.cause.shouldBeInstanceOf<SocketException>()
}

"should return IOError when no response" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1311,8 +1311,7 @@ public fun <B> Either<*, B>.orNull(): B? =
orNull()

/**
* Returns the value from this [Right] or allows clients to transform [Left] to [Right] while providing access to
* the value of [Left].
* Returns the value from this [Right] or allows clients to transform the value from [Left] with the [default] lambda.
*
* Example:
* ```kotlin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public typealias IorNel<A, B> = Ior<Nel<A>, B>
* [Ior]<`A`,`B`> is similar to [Either]<`A`,`B`>, except that it can represent the simultaneous presence of
* an `A` and a `B`. It is right-biased so methods such as `map` and `flatMap` operate on the
* `B` value. Some methods, like `flatMap`, handle the presence of two [Ior.Both] values using a
* `[Semigroup]<`A`>, while other methods, like [toEither], ignore the `A` value in a [Ior.Both Both].
* [Semigroup]<`A`>, while other methods, like [toEither], ignore the `A` value in a [Ior.Both Both].
*
* [Ior]<`A`,`B`> is isomorphic to [Either]<[Either]<`A`,`B`>, [Pair]<`A`,`B`>>, but provides methods biased toward `B`
* values, regardless of whether the `B` values appear in a [Ior.Right] or a [Ior.Both].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,9 @@ public class NonEmptyList<out A>(
@Deprecated(
"Use toNonEmptyListOrNull instead",
ReplaceWith(
"Option.fromNullable<NonEmptyList<A>>(l.toNonEmptyListOrNull())",
"l.toNonEmptyListOrNull().toOption()",
"import arrow.core.toNonEmptyListOrNull",
"import arrow.core.Option",
"import arrow.core.NonEmptyList"
"import arrow.core.toOption"
)
)
@JvmStatic
Expand Down
138 changes: 97 additions & 41 deletions arrow-libs/fx/arrow-fx-coroutines/api/arrow-fx-coroutines.api
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
public final class arrow/fx/coroutines/AcquireStep {
public static final field INSTANCE Larrow/fx/coroutines/AcquireStep;
}

public abstract interface class arrow/fx/coroutines/Atomic {
public static final field Companion Larrow/fx/coroutines/Atomic$Companion;
public abstract fun access (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
Expand Down Expand Up @@ -81,23 +77,28 @@ public final class arrow/fx/coroutines/CircuitBreaker$State$Closed : arrow/fx/co

public final class arrow/fx/coroutines/CircuitBreaker$State$HalfOpen : arrow/fx/coroutines/CircuitBreaker$State {
public fun <init> (D)V
public synthetic fun <init> (JLkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun equals (Ljava/lang/Object;)Z
public final fun getResetTimeout-UwyO8pc ()J
public final fun getResetTimeoutNanos ()D
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class arrow/fx/coroutines/CircuitBreaker$State$Open : arrow/fx/coroutines/CircuitBreaker$State {
public fun <init> (JD)V
public synthetic fun <init> (JJLkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun equals (Ljava/lang/Object;)Z
public final fun getExpiresAt ()J
public final fun getResetTimeout-UwyO8pc ()J
public final fun getResetTimeoutNanos ()D
public final fun getStartedAt ()J
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public abstract class arrow/fx/coroutines/ExitCase {
public static final field Companion Larrow/fx/coroutines/ExitCase$Companion;
}

public final class arrow/fx/coroutines/ExitCase$Cancelled : arrow/fx/coroutines/ExitCase {
Expand All @@ -111,6 +112,10 @@ public final class arrow/fx/coroutines/ExitCase$Cancelled : arrow/fx/coroutines/
public fun toString ()Ljava/lang/String;
}

public final class arrow/fx/coroutines/ExitCase$Companion {
public final fun ExitCase (Ljava/lang/Throwable;)Larrow/fx/coroutines/ExitCase;
}

public final class arrow/fx/coroutines/ExitCase$Completed : arrow/fx/coroutines/ExitCase {
public static final field INSTANCE Larrow/fx/coroutines/ExitCase$Completed;
public fun toString ()Ljava/lang/String;
Expand Down Expand Up @@ -305,48 +310,81 @@ public final class arrow/fx/coroutines/Race3Kt {
public static synthetic fun raceN$default (Lkotlin/coroutines/CoroutineContext;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
}

public abstract interface annotation class arrow/fx/coroutines/ResourceDSL : java/lang/annotation/Annotation {
public abstract class arrow/fx/coroutines/Resource {
public static final field Companion Larrow/fx/coroutines/Resource$Companion;
public final fun allocated (Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final fun ap (Larrow/fx/coroutines/Resource;)Larrow/fx/coroutines/Resource;
public final fun flatMap (Lkotlin/jvm/functions/Function1;)Larrow/fx/coroutines/Resource;
public final fun map (Lkotlin/jvm/functions/Function2;)Larrow/fx/coroutines/Resource;
public final fun parZip (Larrow/fx/coroutines/Resource;Lkotlin/jvm/functions/Function3;)Larrow/fx/coroutines/Resource;
public final fun parZip (Lkotlin/coroutines/CoroutineContext;Larrow/fx/coroutines/Resource;Lkotlin/jvm/functions/Function3;)Larrow/fx/coroutines/Resource;
public static synthetic fun parZip$default (Larrow/fx/coroutines/Resource;Lkotlin/coroutines/CoroutineContext;Larrow/fx/coroutines/Resource;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Larrow/fx/coroutines/Resource;
public final fun tap (Lkotlin/jvm/functions/Function2;)Larrow/fx/coroutines/Resource;
public final fun use (Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public final fun zip (Larrow/fx/coroutines/Resource;)Larrow/fx/coroutines/Resource;
public final fun zip (Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Lkotlin/jvm/functions/Function10;)Larrow/fx/coroutines/Resource;
public final fun zip (Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Lkotlin/jvm/functions/Function9;)Larrow/fx/coroutines/Resource;
public final fun zip (Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Lkotlin/jvm/functions/Function8;)Larrow/fx/coroutines/Resource;
public final fun zip (Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Lkotlin/jvm/functions/Function7;)Larrow/fx/coroutines/Resource;
public final fun zip (Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Lkotlin/jvm/functions/Function6;)Larrow/fx/coroutines/Resource;
public final fun zip (Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Lkotlin/jvm/functions/Function5;)Larrow/fx/coroutines/Resource;
public final fun zip (Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Lkotlin/jvm/functions/Function4;)Larrow/fx/coroutines/Resource;
public final fun zip (Larrow/fx/coroutines/Resource;Larrow/fx/coroutines/Resource;Lkotlin/jvm/functions/Function3;)Larrow/fx/coroutines/Resource;
public final fun zip (Larrow/fx/coroutines/Resource;Lkotlin/jvm/functions/Function2;)Larrow/fx/coroutines/Resource;
}

public final class arrow/fx/coroutines/Resource$Allocate : arrow/fx/coroutines/Resource {
public fun <init> (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;)V
public final fun getAcquire ()Lkotlin/jvm/functions/Function1;
public final fun getRelease ()Lkotlin/jvm/functions/Function3;
}

public final class arrow/fx/coroutines/Resource$Bind : arrow/fx/coroutines/Resource {
public fun <init> (Larrow/fx/coroutines/Resource;Lkotlin/jvm/functions/Function1;)V
public final fun getF ()Lkotlin/jvm/functions/Function1;
public final fun getSource ()Larrow/fx/coroutines/Resource;
}

public final class arrow/fx/coroutines/Resource$Companion {
public final fun defer (Lkotlin/jvm/functions/Function1;)Larrow/fx/coroutines/Resource;
public final fun getUnit ()Larrow/fx/coroutines/Resource;
public final fun invoke (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;)Larrow/fx/coroutines/Resource;
public final fun just (Ljava/lang/Object;)Larrow/fx/coroutines/Resource;
}

public final class arrow/fx/coroutines/Resource$Defer : arrow/fx/coroutines/Resource {
public fun <init> (Lkotlin/jvm/functions/Function1;)V
public final fun getResource ()Lkotlin/jvm/functions/Function1;
}

public final class arrow/fx/coroutines/Resource$Dsl : arrow/fx/coroutines/Resource {
public fun <init> (Lkotlin/jvm/functions/Function2;)V
public final fun component1 ()Lkotlin/jvm/functions/Function2;
public final fun copy (Lkotlin/jvm/functions/Function2;)Larrow/fx/coroutines/Resource$Dsl;
public static synthetic fun copy$default (Larrow/fx/coroutines/Resource$Dsl;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Larrow/fx/coroutines/Resource$Dsl;
public fun equals (Ljava/lang/Object;)Z
public final fun getDsl ()Lkotlin/jvm/functions/Function2;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}

public final class arrow/fx/coroutines/ResourceExtensionsKt {
public static final fun autoCloseable (Larrow/fx/coroutines/ResourceScope;Lkotlinx/coroutines/CoroutineDispatcher;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun autoCloseable (Lkotlinx/coroutines/CoroutineDispatcher;Lkotlin/jvm/functions/Function1;)Lkotlin/jvm/functions/Function2;
public static synthetic fun autoCloseable$default (Larrow/fx/coroutines/ResourceScope;Lkotlinx/coroutines/CoroutineDispatcher;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static synthetic fun autoCloseable$default (Lkotlinx/coroutines/CoroutineDispatcher;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lkotlin/jvm/functions/Function2;
public static final fun closeable (Larrow/fx/coroutines/ResourceScope;Lkotlinx/coroutines/CoroutineDispatcher;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun closeable (Lkotlinx/coroutines/CoroutineDispatcher;Lkotlin/jvm/functions/Function1;)Lkotlin/jvm/functions/Function2;
public static synthetic fun closeable$default (Larrow/fx/coroutines/ResourceScope;Lkotlinx/coroutines/CoroutineDispatcher;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static synthetic fun closeable$default (Lkotlinx/coroutines/CoroutineDispatcher;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lkotlin/jvm/functions/Function2;
public static final fun executor-KLykuaI (JLkotlinx/coroutines/CoroutineDispatcher;Lkotlin/jvm/functions/Function1;)Lkotlin/jvm/functions/Function2;
public static synthetic fun executor-KLykuaI$default (JLkotlinx/coroutines/CoroutineDispatcher;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lkotlin/jvm/functions/Function2;
public static final fun executor-WPwdCS8 (Larrow/fx/coroutines/ResourceScope;JLkotlinx/coroutines/CoroutineDispatcher;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static synthetic fun executor-WPwdCS8$default (Larrow/fx/coroutines/ResourceScope;JLkotlinx/coroutines/CoroutineDispatcher;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
public static final fun fixedThreadPoolContext (ILjava/lang/String;)Lkotlin/jvm/functions/Function2;
public static final fun fixedThreadPoolContext (Larrow/fx/coroutines/ResourceScope;ILjava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun singleThreadContext (Larrow/fx/coroutines/ResourceScope;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun singleThreadContext (Ljava/lang/String;)Lkotlin/jvm/functions/Function2;
public static final fun fromAutoCloseable (Larrow/fx/coroutines/Resource$Companion;Lkotlin/jvm/functions/Function1;)Larrow/fx/coroutines/Resource;
public static final fun fromCloseable (Larrow/fx/coroutines/Resource$Companion;Lkotlin/jvm/functions/Function1;)Larrow/fx/coroutines/Resource;
public static final fun fromExecutor (Larrow/fx/coroutines/Resource$Companion;Lkotlin/jvm/functions/Function1;)Larrow/fx/coroutines/Resource;
public static final fun singleThreadContext (Larrow/fx/coroutines/Resource$Companion;Ljava/lang/String;)Larrow/fx/coroutines/Resource;
}

public final class arrow/fx/coroutines/ResourceKt {
public static final fun asFlow (Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static final fun resource (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;)Lkotlin/jvm/functions/Function2;
public static final fun resource (Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function2;
public static final fun resourceScope (Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun use (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

public abstract interface class arrow/fx/coroutines/ResourceScope {
public abstract fun bind (Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun install (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun onRelease (Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun release (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun releaseCase (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

public final class arrow/fx/coroutines/ResourceScope$DefaultImpls {
public static fun onRelease (Larrow/fx/coroutines/ResourceScope;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static fun release (Larrow/fx/coroutines/ResourceScope;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static fun releaseCase (Larrow/fx/coroutines/ResourceScope;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun asFlow (Larrow/fx/coroutines/Resource;)Lkotlinx/coroutines/flow/Flow;
public static final fun release (Larrow/fx/coroutines/Resource;Lkotlin/jvm/functions/Function2;)Larrow/fx/coroutines/Resource;
public static final fun release-zgiIeyo (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;)Larrow/fx/coroutines/Resource;
public static final fun releaseCase (Larrow/fx/coroutines/Resource;Lkotlin/jvm/functions/Function3;)Larrow/fx/coroutines/Resource;
public static final fun releaseCase-zgiIeyo (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;)Larrow/fx/coroutines/Resource;
public static final fun resource (Lkotlin/jvm/functions/Function1;)Lkotlin/jvm/functions/Function1;
public static final fun sequence (Ljava/lang/Iterable;)Larrow/fx/coroutines/Resource;
public static final fun traverse (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function1;)Larrow/fx/coroutines/Resource;
public static final fun traverseResource (Ljava/lang/Iterable;Lkotlin/jvm/functions/Function1;)Larrow/fx/coroutines/Resource;
}

public abstract class arrow/fx/coroutines/Schedule {
Expand Down Expand Up @@ -466,6 +504,24 @@ public final class arrow/fx/coroutines/ScheduleKt {
public static final fun retryOrElseEither (Larrow/fx/coroutines/Schedule;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

public abstract interface annotation class arrow/fx/coroutines/ScopeDSL : java/lang/annotation/Annotation {
public final class arrow/fx/coroutines/Use {
public static final synthetic fun box-impl (Lkotlin/jvm/functions/Function1;)Larrow/fx/coroutines/Use;
public static fun constructor-impl (Lkotlin/jvm/functions/Function1;)Lkotlin/jvm/functions/Function1;
public fun equals (Ljava/lang/Object;)Z
public static fun equals-impl (Lkotlin/jvm/functions/Function1;Ljava/lang/Object;)Z
public static final fun equals-impl0 (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)Z
public fun hashCode ()I
public static fun hashCode-impl (Lkotlin/jvm/functions/Function1;)I
public fun toString ()Ljava/lang/String;
public static fun toString-impl (Lkotlin/jvm/functions/Function1;)Ljava/lang/String;
public final synthetic fun unbox-impl ()Lkotlin/jvm/functions/Function1;
}

public final class arrow/fx/coroutines/continuations/ResourceKt {
public static final fun resource (Lkotlin/jvm/functions/Function2;)Larrow/fx/coroutines/Resource;
}

public abstract interface class arrow/fx/coroutines/continuations/ResourceScope {
public abstract fun bind (Larrow/fx/coroutines/Resource;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ public sealed class ExitCase {

public data class Cancelled(val exception: CancellationException) : ExitCase()
public data class Failure(val failure: Throwable) : ExitCase()

public companion object {
public fun ExitCase(error: Throwable): ExitCase =
if (error is CancellationException) Cancelled(error) else Failure(error)
}
}

/**
Expand Down
Loading