Skip to content

Commit

Permalink
Fixes merge conflict between main and arrow-2 (#2835)
Browse files Browse the repository at this point in the history
* Add Resource.allocated() to decompose Resource into it's allocate and… (#2820)
* [2743] Migrate internal use of CircuitBreaker double to duration (#2748)
* Fix typo (#2824)
* Make the server disconnect test more general (#2822)
* Update NonEmptyList.fromList deprecation to suggest `toOption()` instead (#2832)
* Improve Either.getOrHandle() docs (#2833)
* Improve allocated, and fix knit examples
Co-authored-by: Jeff Martin <[email protected]>
Co-authored-by: Martin Moore <[email protected]>
Co-authored-by: valery1707 <[email protected]>
Co-authored-by: Lukasz Kalnik <[email protected]>
Co-authored-by: stylianosgakis <[email protected]>
  • Loading branch information
nomisRev authored Oct 5, 2022
1 parent 6ec972f commit c30621d
Show file tree
Hide file tree
Showing 11 changed files with 372 additions and 86 deletions.
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
10 changes: 10 additions & 0 deletions arrow-libs/fx/arrow-fx-coroutines/api/arrow-fx-coroutines.api
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,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 +116,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 @@ -328,6 +337,7 @@ public final class arrow/fx/coroutines/ResourceExtensionsKt {
}

public final class arrow/fx/coroutines/ResourceKt {
public static final fun allocated (Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
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;
Expand Down
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

0 comments on commit c30621d

Please sign in to comment.