Skip to content

Commit

Permalink
Undo excessive inlining
Browse files Browse the repository at this point in the history
  • Loading branch information
kyay10 committed Nov 16, 2024
1 parent 105c99b commit 4227b37
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions arrow-libs/core/arrow-core/api/arrow-core.klib.api
Original file line number Diff line number Diff line change
Expand Up @@ -1000,6 +1000,8 @@ final inline fun <#A: reified kotlin/Throwable, #B: kotlin/Any?, #C: kotlin/Any?
final inline fun <#A: reified kotlin/Throwable, #B: kotlin/Any?, #C: kotlin/Any?> arrow.core.raise/recover(kotlin/Function1<arrow.core.raise/Raise<#B>, #C>, kotlin/Function1<#B, #C>, kotlin/Function1<#A, #C>): #C // arrow.core.raise/recover|recover(kotlin.Function1<arrow.core.raise.Raise<0:1>,0:2>;kotlin.Function1<0:1,0:2>;kotlin.Function1<0:0,0:2>){0§<kotlin.Throwable>;1§<kotlin.Any?>;2§<kotlin.Any?>}[0]
final inline fun <#A: reified kotlin/Throwable, #B: kotlin/Any?> arrow.core.raise/catch(kotlin/Function0<#B>, kotlin/Function1<#A, #B>): #B // arrow.core.raise/catch|catch(kotlin.Function0<0:1>;kotlin.Function1<0:0,0:1>){0§<kotlin.Throwable>;1§<kotlin.Any?>}[0]
final inline fun arrow.core.raise/impure(kotlin/Function1<arrow.core.raise/SingletonRaise<kotlin/Unit>, kotlin/Unit>) // arrow.core.raise/impure|impure(kotlin.Function1<arrow.core.raise.SingletonRaise<kotlin.Unit>,kotlin.Unit>){}[0]
final suspend fun <#A: kotlin/Any?, #B: kotlin/Any?, #C: kotlin/Any?> (kotlin.coroutines/SuspendFunction1<arrow.core.raise/Raise<#A>, #B>).arrow.core.raise/fold(kotlin.coroutines/SuspendFunction1<#A, #C>, kotlin.coroutines/SuspendFunction1<#B, #C>): #C // arrow.core.raise/fold|[email protected]<arrow.core.raise.Raise<0:0>,0:1>(kotlin.coroutines.SuspendFunction1<0:0,0:2>;kotlin.coroutines.SuspendFunction1<0:1,0:2>){0§<kotlin.Any?>;1§<kotlin.Any?>;2§<kotlin.Any?>}[0]
final suspend fun <#A: kotlin/Any?, #B: kotlin/Any?, #C: kotlin/Any?> (kotlin.coroutines/SuspendFunction1<arrow.core.raise/Raise<#A>, #B>).arrow.core.raise/fold(kotlin.coroutines/SuspendFunction1<kotlin/Throwable, #C>, kotlin.coroutines/SuspendFunction1<#A, #C>, kotlin.coroutines/SuspendFunction1<#B, #C>): #C // arrow.core.raise/fold|[email protected]<arrow.core.raise.Raise<0:0>,0:1>(kotlin.coroutines.SuspendFunction1<kotlin.Throwable,0:2>;kotlin.coroutines.SuspendFunction1<0:0,0:2>;kotlin.coroutines.SuspendFunction1<0:1,0:2>){0§<kotlin.Any?>;1§<kotlin.Any?>;2§<kotlin.Any?>}[0]
final suspend fun <#A: kotlin/Any?, #B: kotlin/Any?> (kotlin.coroutines/SuspendFunction1<arrow.core.raise/Raise<#A>, #B>).arrow.core.raise/getOrNull(): #B? // arrow.core.raise/getOrNull|[email protected]<arrow.core.raise.Raise<0:0>,0:1>(){0§<kotlin.Any?>;1§<kotlin.Any?>}[0]
final suspend fun <#A: kotlin/Any?, #B: kotlin/Any?> (kotlin.coroutines/SuspendFunction1<arrow.core.raise/Raise<#A>, #B>).arrow.core.raise/toEither(): arrow.core/Either<#A, #B> // arrow.core.raise/toEither|[email protected]<arrow.core.raise.Raise<0:0>,0:1>(){0§<kotlin.Any?>;1§<kotlin.Any?>}[0]
final suspend fun <#A: kotlin/Any?, #B: kotlin/Any?> (kotlin.coroutines/SuspendFunction1<arrow.core.raise/Raise<#A>, #B>).arrow.core.raise/toIor(): arrow.core/Ior<#A, #B> // arrow.core.raise/toIor|[email protected]<arrow.core.raise.Raise<0:0>,0:1>(){0§<kotlin.Any?>;1§<kotlin.Any?>}[0]
Expand All @@ -1009,6 +1011,4 @@ final suspend fun <#A: kotlin/Any?> (kotlin.coroutines/SuspendFunction1<arrow.co
final suspend fun <#A: kotlin/Any?> (kotlin.coroutines/SuspendFunction1<arrow.core.raise/Raise<arrow.core/None>, #A>).arrow.core/toOption(): arrow.core/Option<#A> // arrow.core/toOption|[email protected]<arrow.core.raise.Raise<arrow.core.None>,0:0>(){0§<kotlin.Any?>}[0]
final suspend fun <#A: kotlin/Any?> (kotlin.coroutines/SuspendFunction1<arrow.core.raise/Raise<kotlin/Nothing>, #A>).arrow.core.raise/get(): #A // arrow.core.raise/get|[email protected]<arrow.core.raise.Raise<kotlin.Nothing>,0:0>(){0§<kotlin.Any?>}[0]
final suspend fun <#A: kotlin/Any?> (kotlin.coroutines/SuspendFunction1<arrow.core.raise/Raise<kotlin/Throwable>, #A>).arrow.core.raise/toResult(): kotlin/Result<#A> // arrow.core.raise/toResult|[email protected]<arrow.core.raise.Raise<kotlin.Throwable>,0:0>(){0§<kotlin.Any?>}[0]
final suspend inline fun <#A: kotlin/Any?, #B: kotlin/Any?, #C: kotlin/Any?> (kotlin.coroutines/SuspendFunction1<arrow.core.raise/Raise<#A>, #B>).arrow.core.raise/fold(kotlin.coroutines/SuspendFunction1<#A, #C>, kotlin.coroutines/SuspendFunction1<#B, #C>): #C // arrow.core.raise/fold|[email protected]<arrow.core.raise.Raise<0:0>,0:1>(kotlin.coroutines.SuspendFunction1<0:0,0:2>;kotlin.coroutines.SuspendFunction1<0:1,0:2>){0§<kotlin.Any?>;1§<kotlin.Any?>;2§<kotlin.Any?>}[0]
final suspend inline fun <#A: kotlin/Any?, #B: kotlin/Any?, #C: kotlin/Any?> (kotlin.coroutines/SuspendFunction1<arrow.core.raise/Raise<#A>, #B>).arrow.core.raise/fold(kotlin.coroutines/SuspendFunction1<kotlin/Throwable, #C>, kotlin.coroutines/SuspendFunction1<#A, #C>, kotlin.coroutines/SuspendFunction1<#B, #C>): #C // arrow.core.raise/fold|[email protected]<arrow.core.raise.Raise<0:0>,0:1>(kotlin.coroutines.SuspendFunction1<kotlin.Throwable,0:2>;kotlin.coroutines.SuspendFunction1<0:0,0:2>;kotlin.coroutines.SuspendFunction1<0:1,0:2>){0§<kotlin.Any?>;1§<kotlin.Any?>;2§<kotlin.Any?>}[0]
final suspend inline fun <#A: kotlin/Any?, #B: kotlin/Any?> (kotlin.coroutines/SuspendFunction1<arrow.core.raise/Raise<#A>, #B>).arrow.core.raise/getOrElse(kotlin/Function1<#A, #B>): #B // arrow.core.raise/getOrElse|[email protected]<arrow.core.raise.Raise<0:0>,0:1>(kotlin.Function1<0:0,0:1>){0§<kotlin.Any?>;1§<kotlin.Any?>}[0]
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import kotlin.jvm.JvmName
* This method should never be wrapped in `try`/`catch` as it will not throw any unexpected errors,
* it will only result in [CancellationException], or fatal exceptions such as `OutOfMemoryError`.
*/
public suspend inline fun <Error, A, B> Effect<Error, A>.fold(
public suspend fun <Error, A, B> Effect<Error, A>.fold(
catch: suspend (throwable: Throwable) -> B,
recover: suspend (error: Error) -> B,
transform: suspend (value: A) -> B,
Expand All @@ -44,7 +44,7 @@ public suspend inline fun <Error, A, B> Effect<Error, A>.fold(
*
* This function re-throws any exceptions thrown within the [Effect].
*/
public suspend inline fun <Error, A, B> Effect<Error, A>.fold(
public suspend fun <Error, A, B> Effect<Error, A>.fold(
recover: suspend (error: Error) -> B,
transform: suspend (value: A) -> B,
): B {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,12 @@ final fun <#A: kotlin/Any?, #B: kotlin/Any?> (kotlinx.coroutines.flow/Flow<#A>).
final fun <#A: kotlin/Any?> arrow.resilience/saga(kotlin.coroutines/SuspendFunction1<arrow.resilience/SagaActionStep, #A>, kotlin.coroutines/SuspendFunction1<#A, kotlin/Unit>): kotlin.coroutines/SuspendFunction1<arrow.resilience/SagaScope, #A> // arrow.resilience/saga|saga(kotlin.coroutines.SuspendFunction1<arrow.resilience.SagaActionStep,0:0>;kotlin.coroutines.SuspendFunction1<0:0,kotlin.Unit>){0§<kotlin.Any?>}[0]
final inline fun <#A: kotlin/Any?> arrow.resilience/saga(noinline kotlin.coroutines/SuspendFunction1<arrow.resilience/SagaScope, #A>): kotlin.coroutines/SuspendFunction1<arrow.resilience/SagaScope, #A> // arrow.resilience/saga|saga(kotlin.coroutines.SuspendFunction1<arrow.resilience.SagaScope,0:0>){0§<kotlin.Any?>}[0]
final suspend fun <#A: kotlin/Any?> (kotlin.coroutines/SuspendFunction1<arrow.resilience/SagaScope, #A>).arrow.resilience/transact(): #A // arrow.resilience/transact|[email protected]<arrow.resilience.SagaScope,0:0>(){0§<kotlin.Any?>}[0]
final suspend fun <#A: kotlin/Throwable, #B: kotlin/Any?, #C: kotlin/Any?, #D: kotlin/Any?> (arrow.resilience/Schedule<#A, #C>).arrow.resilience/retryOrElseEither(kotlin.reflect/KClass<#A>, kotlin.coroutines/SuspendFunction0<#B>, kotlin.coroutines/SuspendFunction2<#A, #C, #D>): arrow.core/Either<#D, #B> // arrow.resilience/retryOrElseEither|[email protected]<0:0,0:2>(kotlin.reflect.KClass<0:0>;kotlin.coroutines.SuspendFunction0<0:1>;kotlin.coroutines.SuspendFunction2<0:0,0:2,0:3>){0§<kotlin.Throwable>;1§<kotlin.Any?>;2§<kotlin.Any?>;3§<kotlin.Any?>}[0]
final suspend fun <#A: kotlin/Throwable, #B: kotlin/Any?, #C: kotlin/Any?> (arrow.resilience/Schedule<#A, #C>).arrow.resilience/retryOrElse(kotlin.reflect/KClass<#A>, kotlin.coroutines/SuspendFunction0<#B>, kotlin.coroutines/SuspendFunction2<#A, #C, #B>): #B // arrow.resilience/retryOrElse|[email protected]<0:0,0:2>(kotlin.reflect.KClass<0:0>;kotlin.coroutines.SuspendFunction0<0:1>;kotlin.coroutines.SuspendFunction2<0:0,0:2,0:1>){0§<kotlin.Throwable>;1§<kotlin.Any?>;2§<kotlin.Any?>}[0]
final suspend fun <#A: kotlin/Throwable, #B: kotlin/Any?> (arrow.resilience/Schedule<#A, *>).arrow.resilience/retry(kotlin.reflect/KClass<#A>, kotlin.coroutines/SuspendFunction0<#B>): #B // arrow.resilience/retry|[email protected]<0:0,*>(kotlin.reflect.KClass<0:0>;kotlin.coroutines.SuspendFunction0<0:1>){0§<kotlin.Throwable>;1§<kotlin.Any?>}[0]
final suspend inline fun <#A: kotlin/Any?, #B: kotlin/Any?, #C: kotlin/Any?> (arrow.core.raise/Raise<#A>).arrow.resilience/retry(arrow.resilience/Schedule<#A, #C>, kotlin/Function1<arrow.core.raise/Raise<#A>, #B>): #B // arrow.resilience/retry|[email protected]<0:0>(arrow.resilience.Schedule<0:0,0:2>;kotlin.Function1<arrow.core.raise.Raise<0:0>,0:1>){0§<kotlin.Any?>;1§<kotlin.Any?>;2§<kotlin.Any?>}[0]
final suspend inline fun <#A: kotlin/Any?, #B: kotlin/Any?, #C: kotlin/Any?> (arrow.resilience/Schedule<#A, #C>).arrow.resilience/retryEither(kotlin/Function0<arrow.core/Either<#A, #B>>): arrow.core/Either<#A, #B> // arrow.resilience/retryEither|[email protected]<0:0,0:2>(kotlin.Function0<arrow.core.Either<0:0,0:1>>){0§<kotlin.Any?>;1§<kotlin.Any?>;2§<kotlin.Any?>}[0]
final suspend inline fun <#A: kotlin/Any?, #B: kotlin/Any?, #C: kotlin/Any?> (arrow.resilience/Schedule<#A, #C>).arrow.resilience/retryRaise(kotlin/Function1<arrow.core.raise/Raise<#A>, #B>): arrow.core/Either<#A, #B> // arrow.resilience/retryRaise|[email protected]<0:0,0:2>(kotlin.Function1<arrow.core.raise.Raise<0:0>,0:1>){0§<kotlin.Any?>;1§<kotlin.Any?>;2§<kotlin.Any?>}[0]
final suspend inline fun <#A: kotlin/Throwable, #B: kotlin/Any?, #C: kotlin/Any?, #D: kotlin/Any?> (arrow.resilience/Schedule<#A, #C>).arrow.resilience/retryOrElseEither(kotlin.reflect/KClass<#A>, kotlin.coroutines/SuspendFunction0<#B>, kotlin.coroutines/SuspendFunction2<#A, #C, #D>): arrow.core/Either<#D, #B> // arrow.resilience/retryOrElseEither|[email protected]<0:0,0:2>(kotlin.reflect.KClass<0:0>;kotlin.coroutines.SuspendFunction0<0:1>;kotlin.coroutines.SuspendFunction2<0:0,0:2,0:3>){0§<kotlin.Throwable>;1§<kotlin.Any?>;2§<kotlin.Any?>;3§<kotlin.Any?>}[0]
final suspend inline fun <#A: kotlin/Throwable, #B: kotlin/Any?, #C: kotlin/Any?> (arrow.resilience/Schedule<#A, #C>).arrow.resilience/retryOrElse(kotlin.reflect/KClass<#A>, kotlin.coroutines/SuspendFunction0<#B>, kotlin.coroutines/SuspendFunction2<#A, #C, #B>): #B // arrow.resilience/retryOrElse|[email protected]<0:0,0:2>(kotlin.reflect.KClass<0:0>;kotlin.coroutines.SuspendFunction0<0:1>;kotlin.coroutines.SuspendFunction2<0:0,0:2,0:1>){0§<kotlin.Throwable>;1§<kotlin.Any?>;2§<kotlin.Any?>}[0]
final suspend inline fun <#A: kotlin/Throwable, #B: kotlin/Any?> (arrow.resilience/Schedule<#A, *>).arrow.resilience/retry(kotlin.reflect/KClass<#A>, kotlin.coroutines/SuspendFunction0<#B>): #B // arrow.resilience/retry|[email protected]<0:0,*>(kotlin.reflect.KClass<0:0>;kotlin.coroutines.SuspendFunction0<0:1>){0§<kotlin.Throwable>;1§<kotlin.Any?>}[0]
final suspend inline fun <#A: reified kotlin/Throwable, #B: kotlin/Any?, #C: kotlin/Any?, #D: kotlin/Any?> (arrow.resilience/Schedule<#A, #C>).arrow.resilience/retryOrElseEither(kotlin.coroutines/SuspendFunction0<#B>, kotlin.coroutines/SuspendFunction2<#A, #C, #D>): arrow.core/Either<#D, #B> // arrow.resilience/retryOrElseEither|[email protected]<0:0,0:2>(kotlin.coroutines.SuspendFunction0<0:1>;kotlin.coroutines.SuspendFunction2<0:0,0:2,0:3>){0§<kotlin.Throwable>;1§<kotlin.Any?>;2§<kotlin.Any?>;3§<kotlin.Any?>}[0]
final suspend inline fun <#A: reified kotlin/Throwable, #B: kotlin/Any?, #C: kotlin/Any?> (arrow.resilience/Schedule<#A, #C>).arrow.resilience/retryOrElse(kotlin.coroutines/SuspendFunction0<#B>, kotlin.coroutines/SuspendFunction2<kotlin/Throwable, #C, #B>): #B // arrow.resilience/retryOrElse|[email protected]<0:0,0:2>(kotlin.coroutines.SuspendFunction0<0:1>;kotlin.coroutines.SuspendFunction2<kotlin.Throwable,0:2,0:1>){0§<kotlin.Throwable>;1§<kotlin.Any?>;2§<kotlin.Any?>}[0]
final suspend inline fun <#A: reified kotlin/Throwable, #B: kotlin/Any?> (arrow.resilience/Schedule<#A, *>).arrow.resilience/retry(kotlin.coroutines/SuspendFunction0<#B>): #B // arrow.resilience/retry|[email protected]<0:0,*>(kotlin.coroutines.SuspendFunction0<0:1>){0§<kotlin.Throwable>;1§<kotlin.Any?>}[0]
final suspend inline fun <#A: reified kotlin/Throwable, #B: kotlin/Any?, #C: kotlin/Any?, #D: kotlin/Any?> (arrow.resilience/Schedule<#A, #C>).arrow.resilience/retryOrElseEither(noinline kotlin.coroutines/SuspendFunction0<#B>, noinline kotlin.coroutines/SuspendFunction2<#A, #C, #D>): arrow.core/Either<#D, #B> // arrow.resilience/retryOrElseEither|[email protected]<0:0,0:2>(kotlin.coroutines.SuspendFunction0<0:1>;kotlin.coroutines.SuspendFunction2<0:0,0:2,0:3>){0§<kotlin.Throwable>;1§<kotlin.Any?>;2§<kotlin.Any?>;3§<kotlin.Any?>}[0]
final suspend inline fun <#A: reified kotlin/Throwable, #B: kotlin/Any?, #C: kotlin/Any?> (arrow.resilience/Schedule<#A, #C>).arrow.resilience/retryOrElse(noinline kotlin.coroutines/SuspendFunction0<#B>, noinline kotlin.coroutines/SuspendFunction2<kotlin/Throwable, #C, #B>): #B // arrow.resilience/retryOrElse|[email protected]<0:0,0:2>(kotlin.coroutines.SuspendFunction0<0:1>;kotlin.coroutines.SuspendFunction2<kotlin.Throwable,0:2,0:1>){0§<kotlin.Throwable>;1§<kotlin.Any?>;2§<kotlin.Any?>}[0]
final suspend inline fun <#A: reified kotlin/Throwable, #B: kotlin/Any?> (arrow.resilience/Schedule<#A, *>).arrow.resilience/retry(noinline kotlin.coroutines/SuspendFunction0<#B>): #B // arrow.resilience/retry|[email protected]<0:0,*>(kotlin.coroutines.SuspendFunction0<0:1>){0§<kotlin.Throwable>;1§<kotlin.Any?>}[0]
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ public fun interface Schedule<in Input, out Output> {
* It will throw the last exception if the [Schedule] is exhausted, and ignores the output of the [Schedule].
*/
public suspend inline fun <reified E: Throwable, A> Schedule<E, *>.retry(
action: suspend () -> A
noinline action: suspend () -> A
): A {
contract {
callsInPlace(action, InvocationKind.AT_LEAST_ONCE)
Expand All @@ -428,8 +428,8 @@ public suspend inline fun <reified E: Throwable, A> Schedule<E, *>.retry(
* Retries [action] using any [E] that occurred as the input to the [Schedule].
* It will throw the last exception if the [Schedule] is exhausted, and ignores the output of the [Schedule].
*/
@Suppress("WRONG_INVOCATION_KIND")
public suspend inline fun <E: Throwable, A> Schedule<E, *>.retry(
@Suppress("LEAKED_IN_PLACE_LAMBDA", "WRONG_INVOCATION_KIND")
public suspend fun <E: Throwable, A> Schedule<E, *>.retry(
exceptionClass: KClass<E>,
action: suspend () -> A
): A {
Expand All @@ -444,16 +444,16 @@ public suspend inline fun <E: Throwable, A> Schedule<E, *>.retry(
* it will invoke [orElse] with the last exception and the output of the [Schedule] to produce a fallback [Input] value.
*/
public suspend inline fun <reified E: Throwable, Input, Output> Schedule<E, Output>.retryOrElse(
action: suspend () -> Input,
orElse: suspend (Throwable, Output) -> Input
noinline action: suspend () -> Input,
noinline orElse: suspend (Throwable, Output) -> Input
): Input = retryOrElse(E::class, action, orElse)

/**
* Retries [action] using any [E] that occurred as the input to the [Schedule].
* If the [Schedule] is exhausted,
* it will invoke [orElse] with the last exception and the output of the [Schedule] to produce a fallback [Input] value.
*/
public suspend inline fun <E: Throwable, Input, Output> Schedule<E, Output>.retryOrElse(
public suspend fun <E: Throwable, Input, Output> Schedule<E, Output>.retryOrElse(
exceptionClass: KClass<E>,
action: suspend () -> Input,
orElse: suspend (E, Output) -> Input
Expand All @@ -466,8 +466,8 @@ public suspend inline fun <E: Throwable, Input, Output> Schedule<E, Output>.retr
* Returns [Either] with the fallback value if the [Schedule] is exhausted, or the successful result of [action].
*/
public suspend inline fun <reified E: Throwable, Input, Output, A> Schedule<E, Output>.retryOrElseEither(
action: suspend () -> Input,
orElse: suspend (E, Output) -> A
noinline action: suspend () -> Input,
noinline orElse: suspend (E, Output) -> A
): Either<A, Input> = retryOrElseEither(E::class, action, orElse)

/**
Expand All @@ -476,7 +476,7 @@ public suspend inline fun <reified E: Throwable, Input, Output, A> Schedule<E, O
* it will invoke [orElse] with the last exception and the output of the [Schedule] to produce a fallback value of [A].
* Returns [Either] with the fallback value if the [Schedule] is exhausted, or the successful result of [action].
*/
public suspend inline fun <E: Throwable, Input, Output, A> Schedule<E, Output>.retryOrElseEither(
public suspend fun <E: Throwable, Input, Output, A> Schedule<E, Output>.retryOrElseEither(
exceptionClass: KClass<E>,
action: suspend () -> Input,
orElse: suspend (E, Output) -> A
Expand Down

0 comments on commit 4227b37

Please sign in to comment.