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

Make Schedule a fun interface #3504

Merged
merged 6 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import kotlin.test.Test
class ListKTest {

@Test fun monoidLaws() =
testLaws(MonoidLaws("List", emptyList(), List<Int>::plus, Arb.list(Arb.int())))
testLaws(MonoidLaws("List", emptyList(), { x: List<Int>, y: List<Int> -> x + y }, Arb.list(Arb.int())))

@Test fun mapNotNullOk() = runTest {
checkAll(Arb.list(Arb.int())) { listk ->
Expand Down
4 changes: 1 addition & 3 deletions arrow-libs/optics/arrow-optics-compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl


repositories {
google()
Expand Down Expand Up @@ -37,7 +35,7 @@ kotlin {
browser()
nodejs()
}
@OptIn(ExperimentalWasmDsl::class) wasmJs()
@OptIn(org.jetbrains.kotlin.gradle.ExperimentalWasmDsl::class) wasmJs()
androidTarget()
// Native: https://kotlinlang.org/docs/native-target-support.html
// -- Tier 1 --
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
@file:JvmName("ComposeFlowKt")
@file:OptIn(ExperimentalCoroutinesApi::class, ExperimentalForInheritanceCoroutinesApi::class)

package arrow.optics

import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.ExperimentalForInheritanceCoroutinesApi
import kotlinx.coroutines.flow.FlowCollector
import kotlinx.coroutines.flow.MutableStateFlow
import kotlinx.coroutines.flow.SharedFlow
Expand Down Expand Up @@ -66,7 +68,6 @@ public fun <T, A> MutableStateFlow<T>.optic(lens: Lens<T, A>): MutableStateFlow<
override val replayCache: List<A>
get() = [email protected] { lens.get(it) }

@ExperimentalCoroutinesApi
override fun resetReplayCache() {
[email protected]()
}
Expand Down
122 changes: 69 additions & 53 deletions arrow-libs/resilience/arrow-resilience/api/arrow-resilience.api
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public final class arrow/resilience/CircuitBreaker$State$Open : arrow/resilience
}

public final class arrow/resilience/FlowKt {
public static final fun retry-z663S_Q (Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
public static final fun retry (Lkotlinx/coroutines/flow/Flow;Larrow/resilience/Schedule;)Lkotlinx/coroutines/flow/Flow;
}

public final class arrow/resilience/SagaActionStep {
Expand Down Expand Up @@ -133,56 +133,46 @@ public final class arrow/resilience/SagaScope$DefaultImpls {
public static fun invoke (Larrow/resilience/SagaScope;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

public final class arrow/resilience/Schedule {
public abstract interface class arrow/resilience/Schedule {
public static final field Companion Larrow/resilience/Schedule$Companion;
public static final fun and-6Pcb-r4 (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;)Lkotlin/jvm/functions/Function2;
public static final fun and-GI_V1oY (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function2;
public static final fun and-JfEqqxs (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;)Lkotlin/jvm/functions/Function2;
public static final fun andThen-GI_V1oY (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function2;
public static final fun andThen-JfEqqxs (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function2;
public static final synthetic fun box-impl (Lkotlin/jvm/functions/Function2;)Larrow/resilience/Schedule;
public static final fun collect-k5utPk0 (Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function2;
public static fun constructor-impl (Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function2;
public static final fun contramap-ZhmCDx4 (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function2;
public static final fun delayed-ZhmCDx4 (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;)Lkotlin/jvm/functions/Function2;
public static final fun doUntil-ZhmCDx4 (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;)Lkotlin/jvm/functions/Function2;
public static final fun doWhile-ZhmCDx4 (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;)Lkotlin/jvm/functions/Function2;
public fun equals (Ljava/lang/Object;)Z
public static fun equals-impl (Lkotlin/jvm/functions/Function2;Ljava/lang/Object;)Z
public static final fun equals-impl0 (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;)Z
public static final fun fold-juJHlvs (Lkotlin/jvm/functions/Function2;Ljava/lang/Object;Lkotlin/jvm/functions/Function3;)Lkotlin/jvm/functions/Function2;
public final fun getStep ()Lkotlin/jvm/functions/Function2;
public fun hashCode ()I
public static fun hashCode-impl (Lkotlin/jvm/functions/Function2;)I
public static final fun jittered-Q7pyTlY (Lkotlin/jvm/functions/Function2;DDLkotlin/random/Random;)Lkotlin/jvm/functions/Function2;
public static synthetic fun jittered-Q7pyTlY$default (Lkotlin/jvm/functions/Function2;DDLkotlin/random/Random;ILjava/lang/Object;)Lkotlin/jvm/functions/Function2;
public static final fun log-ZhmCDx4 (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;)Lkotlin/jvm/functions/Function2;
public static final fun map-ZhmCDx4 (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function2;
public static final fun mapDecision-ZhmCDx4 (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function2;
public static final fun or-JfEqqxs (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;)Lkotlin/jvm/functions/Function2;
public static final fun repeat-impl (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun repeatOrElse-impl (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun repeatOrElseEither-impl (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public fun toString ()Ljava/lang/String;
public static fun toString-impl (Lkotlin/jvm/functions/Function2;)Ljava/lang/String;
public final synthetic fun unbox-impl ()Lkotlin/jvm/functions/Function2;
public static final fun zipLeft-GI_V1oY (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function2;
public static final fun zipRight-GI_V1oY (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function2;
public abstract fun and (Larrow/resilience/Schedule;)Larrow/resilience/Schedule;
public abstract fun and (Larrow/resilience/Schedule;Lkotlin/jvm/functions/Function3;)Larrow/resilience/Schedule;
public abstract fun and (Larrow/resilience/Schedule;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;)Larrow/resilience/Schedule;
public abstract fun andThen (Larrow/resilience/Schedule;)Larrow/resilience/Schedule;
public abstract fun andThen (Larrow/resilience/Schedule;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;)Larrow/resilience/Schedule;
public abstract fun collect ()Larrow/resilience/Schedule;
public abstract fun contramap (Lkotlin/jvm/functions/Function2;)Larrow/resilience/Schedule;
public abstract fun delayed (Lkotlin/jvm/functions/Function3;)Larrow/resilience/Schedule;
public abstract fun doUntil (Lkotlin/jvm/functions/Function3;)Larrow/resilience/Schedule;
public abstract fun doWhile (Lkotlin/jvm/functions/Function3;)Larrow/resilience/Schedule;
public abstract fun fold (Ljava/lang/Object;Lkotlin/jvm/functions/Function3;)Larrow/resilience/Schedule;
public abstract fun getStep ()Lkotlin/jvm/functions/Function2;
public abstract fun invoke (Ljava/lang/Object;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun jittered (DDLkotlin/random/Random;)Larrow/resilience/Schedule;
public abstract fun log (Lkotlin/jvm/functions/Function3;)Larrow/resilience/Schedule;
public abstract fun map (Lkotlin/jvm/functions/Function2;)Larrow/resilience/Schedule;
public abstract fun mapDecision (Lkotlin/jvm/functions/Function2;)Larrow/resilience/Schedule;
public abstract fun or (Larrow/resilience/Schedule;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;)Larrow/resilience/Schedule;
public abstract fun repeat (Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun repeatOrElse (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun repeatOrElseEither (Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public abstract fun zipLeft (Larrow/resilience/Schedule;)Larrow/resilience/Schedule;
public abstract fun zipRight (Larrow/resilience/Schedule;)Larrow/resilience/Schedule;
}

public final class arrow/resilience/Schedule$Companion {
public final fun collect-k5utPk0 ()Lkotlin/jvm/functions/Function2;
public final fun doUntil-ZhmCDx4 (Lkotlin/jvm/functions/Function3;)Lkotlin/jvm/functions/Function2;
public final fun doWhile-ZhmCDx4 (Lkotlin/jvm/functions/Function3;)Lkotlin/jvm/functions/Function2;
public final fun exponential-la_RjoE (JD)Lkotlin/jvm/functions/Function2;
public static synthetic fun exponential-la_RjoE$default (Larrow/resilience/Schedule$Companion;JDILjava/lang/Object;)Lkotlin/jvm/functions/Function2;
public final fun fibonacci-0qC2UY4 (J)Lkotlin/jvm/functions/Function2;
public final fun forever-k5utPk0 ()Lkotlin/jvm/functions/Function2;
public final fun identity-k5utPk0 ()Lkotlin/jvm/functions/Function2;
public final fun linear-0qC2UY4 (J)Lkotlin/jvm/functions/Function2;
public final fun recurs-ZhmCDx4 (J)Lkotlin/jvm/functions/Function2;
public final fun spaced-0qC2UY4 (J)Lkotlin/jvm/functions/Function2;
public final fun unfold-juJHlvs (Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function2;
public final fun collect ()Larrow/resilience/Schedule;
public final fun doUntil (Lkotlin/jvm/functions/Function3;)Larrow/resilience/Schedule;
public final fun doWhile (Lkotlin/jvm/functions/Function3;)Larrow/resilience/Schedule;
public final fun exponential-VtjQ1oo (JD)Larrow/resilience/Schedule;
public static synthetic fun exponential-VtjQ1oo$default (Larrow/resilience/Schedule$Companion;JDILjava/lang/Object;)Larrow/resilience/Schedule;
public final fun fibonacci-LRDsOJo (J)Larrow/resilience/Schedule;
public final fun forever ()Larrow/resilience/Schedule;
public final fun identity ()Larrow/resilience/Schedule;
public final fun linear-LRDsOJo (J)Larrow/resilience/Schedule;
public final fun recurs (J)Larrow/resilience/Schedule;
public final fun spaced-LRDsOJo (J)Larrow/resilience/Schedule;
public final fun unfold (Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)Larrow/resilience/Schedule;
}

public abstract interface class arrow/resilience/Schedule$Decision {
Expand Down Expand Up @@ -250,13 +240,39 @@ public final class arrow/resilience/Schedule$Decision$Done : arrow/resilience/Sc
public fun toString ()Ljava/lang/String;
}

public final class arrow/resilience/Schedule$DefaultImpls {
public static fun and (Larrow/resilience/Schedule;Larrow/resilience/Schedule;)Larrow/resilience/Schedule;
public static fun and (Larrow/resilience/Schedule;Larrow/resilience/Schedule;Lkotlin/jvm/functions/Function3;)Larrow/resilience/Schedule;
public static fun and (Larrow/resilience/Schedule;Larrow/resilience/Schedule;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;)Larrow/resilience/Schedule;
public static fun andThen (Larrow/resilience/Schedule;Larrow/resilience/Schedule;)Larrow/resilience/Schedule;
public static fun andThen (Larrow/resilience/Schedule;Larrow/resilience/Schedule;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;)Larrow/resilience/Schedule;
public static fun collect (Larrow/resilience/Schedule;)Larrow/resilience/Schedule;
public static fun contramap (Larrow/resilience/Schedule;Lkotlin/jvm/functions/Function2;)Larrow/resilience/Schedule;
public static fun delayed (Larrow/resilience/Schedule;Lkotlin/jvm/functions/Function3;)Larrow/resilience/Schedule;
public static fun doUntil (Larrow/resilience/Schedule;Lkotlin/jvm/functions/Function3;)Larrow/resilience/Schedule;
public static fun doWhile (Larrow/resilience/Schedule;Lkotlin/jvm/functions/Function3;)Larrow/resilience/Schedule;
public static fun fold (Larrow/resilience/Schedule;Ljava/lang/Object;Lkotlin/jvm/functions/Function3;)Larrow/resilience/Schedule;
public static fun getStep (Larrow/resilience/Schedule;)Lkotlin/jvm/functions/Function2;
public static fun jittered (Larrow/resilience/Schedule;DDLkotlin/random/Random;)Larrow/resilience/Schedule;
public static synthetic fun jittered$default (Larrow/resilience/Schedule;DDLkotlin/random/Random;ILjava/lang/Object;)Larrow/resilience/Schedule;
public static fun log (Larrow/resilience/Schedule;Lkotlin/jvm/functions/Function3;)Larrow/resilience/Schedule;
public static fun map (Larrow/resilience/Schedule;Lkotlin/jvm/functions/Function2;)Larrow/resilience/Schedule;
public static fun mapDecision (Larrow/resilience/Schedule;Lkotlin/jvm/functions/Function2;)Larrow/resilience/Schedule;
public static fun or (Larrow/resilience/Schedule;Larrow/resilience/Schedule;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;)Larrow/resilience/Schedule;
public static fun repeat (Larrow/resilience/Schedule;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static fun repeatOrElse (Larrow/resilience/Schedule;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static fun repeatOrElseEither (Larrow/resilience/Schedule;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static fun zipLeft (Larrow/resilience/Schedule;Larrow/resilience/Schedule;)Larrow/resilience/Schedule;
public static fun zipRight (Larrow/resilience/Schedule;Larrow/resilience/Schedule;)Larrow/resilience/Schedule;
}

public final class arrow/resilience/ScheduleKt {
public static final fun retry-YL6hcnA (Larrow/core/raise/Raise;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun retry-aZo8_V4 (Lkotlin/jvm/functions/Function2;Lkotlin/reflect/KClass;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun retryEither-4AuOtiA (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function0;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun retryOrElse-quv6EbI (Lkotlin/jvm/functions/Function2;Lkotlin/reflect/KClass;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun retryOrElseEither-quv6EbI (Lkotlin/jvm/functions/Function2;Lkotlin/reflect/KClass;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun retryRaise-4AuOtiA (Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun retry (Larrow/core/raise/Raise;Larrow/resilience/Schedule;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun retry (Larrow/resilience/Schedule;Lkotlin/reflect/KClass;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun retryEither (Larrow/resilience/Schedule;Lkotlin/jvm/functions/Function0;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun retryOrElse (Larrow/resilience/Schedule;Lkotlin/reflect/KClass;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun retryOrElseEither (Larrow/resilience/Schedule;Lkotlin/reflect/KClass;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
public static final fun retryRaise (Larrow/resilience/Schedule;Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
}

public final class arrow/resilience/common/Platform : java/lang/Enum {
Expand Down
Loading