Skip to content

Commit

Permalink
Separate 'arrow-eval' module (#3332)
Browse files Browse the repository at this point in the history
  • Loading branch information
serras authored Jan 17, 2024
1 parent a64bd39 commit 79a791f
Show file tree
Hide file tree
Showing 13 changed files with 945 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ import kotlin.jvm.JvmStatic
* <!--- KNIT example-eval-01.kt -->
*
*/
@Deprecated("Eval is deprecated in Arrow Core and will be removed in 2.x.x. \n If Eval is crucial for you, please let us know on the Arrow Github. Thanks!\n" + " https://github.com/arrow-kt/arrow/issues\n")
@Deprecated(
"This is now part of the arrow-eval module, and will be removed from arrow-core in version 2.0. Please update your project dependencies.",
ReplaceWith("Eval", "arrow.eval.Eval")
)
public sealed class Eval<out A> {

public companion object {
Expand Down
106 changes: 106 additions & 0 deletions arrow-libs/core/arrow-eval/api/arrow-eval.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
public abstract class arrow/eval/Eval {
public static final field Companion Larrow/eval/Eval$Companion;
public static final fun always (Lkotlin/jvm/functions/Function0;)Larrow/eval/Eval$Always;
public final fun coflatMap (Lkotlin/jvm/functions/Function1;)Larrow/eval/Eval;
public static final fun defer (Lkotlin/jvm/functions/Function0;)Larrow/eval/Eval;
public final fun flatMap (Lkotlin/jvm/functions/Function1;)Larrow/eval/Eval;
public final fun invoke ()Ljava/lang/Object;
public static final fun later (Lkotlin/jvm/functions/Function0;)Larrow/eval/Eval$Later;
public final fun map (Lkotlin/jvm/functions/Function1;)Larrow/eval/Eval;
public abstract fun memoize ()Larrow/eval/Eval;
public static final fun now (Ljava/lang/Object;)Larrow/eval/Eval;
public static final fun raise (Ljava/lang/Throwable;)Larrow/eval/Eval;
public fun toString ()Ljava/lang/String;
public abstract fun value ()Ljava/lang/Object;
}

public final class arrow/eval/Eval$Always : arrow/eval/Eval {
public fun <init> (Lkotlin/jvm/functions/Function0;)V
public final fun copy (Lkotlin/jvm/functions/Function0;)Larrow/eval/Eval$Always;
public static synthetic fun copy$default (Larrow/eval/Eval$Always;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)Larrow/eval/Eval$Always;
public fun equals (Ljava/lang/Object;)Z
public fun hashCode ()I
public fun memoize ()Larrow/eval/Eval;
public fun toString ()Ljava/lang/String;
public fun value ()Ljava/lang/Object;
}

public final class arrow/eval/Eval$Companion {
public final fun always (Lkotlin/jvm/functions/Function0;)Larrow/eval/Eval$Always;
public final fun defer (Lkotlin/jvm/functions/Function0;)Larrow/eval/Eval;
public final fun later (Lkotlin/jvm/functions/Function0;)Larrow/eval/Eval$Later;
public final fun now (Ljava/lang/Object;)Larrow/eval/Eval;
public final fun raise (Ljava/lang/Throwable;)Larrow/eval/Eval;
}

public final class arrow/eval/Eval$Defer : arrow/eval/Eval {
public fun <init> (Lkotlin/jvm/functions/Function0;)V
public final fun component1 ()Lkotlin/jvm/functions/Function0;
public final fun copy (Lkotlin/jvm/functions/Function0;)Larrow/eval/Eval$Defer;
public static synthetic fun copy$default (Larrow/eval/Eval$Defer;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)Larrow/eval/Eval$Defer;
public fun equals (Ljava/lang/Object;)Z
public final fun getThunk ()Lkotlin/jvm/functions/Function0;
public fun hashCode ()I
public fun memoize ()Larrow/eval/Eval;
public fun toString ()Ljava/lang/String;
public fun value ()Ljava/lang/Object;
}

public abstract class arrow/eval/Eval$FlatMap : arrow/eval/Eval {
public fun <init> ()V
public fun memoize ()Larrow/eval/Eval;
public abstract fun run (Ljava/lang/Object;)Larrow/eval/Eval;
public abstract fun start ()Larrow/eval/Eval;
public fun toString ()Ljava/lang/String;
public fun value ()Ljava/lang/Object;
}

public final class arrow/eval/Eval$Later : arrow/eval/Eval, kotlin/Lazy {
public fun <init> (Lkotlin/jvm/functions/Function0;)V
public final fun copy (Lkotlin/jvm/functions/Function0;)Larrow/eval/Eval$Later;
public static synthetic fun copy$default (Larrow/eval/Eval$Later;Lkotlin/jvm/functions/Function0;ILjava/lang/Object;)Larrow/eval/Eval$Later;
public fun equals (Ljava/lang/Object;)Z
public fun getValue ()Ljava/lang/Object;
public fun hashCode ()I
public fun isInitialized ()Z
public fun memoize ()Larrow/eval/Eval;
public fun toString ()Ljava/lang/String;
public fun value ()Ljava/lang/Object;
}

public final class arrow/eval/Eval$Now : arrow/eval/Eval, kotlin/Lazy {
public static final field Companion Larrow/eval/Eval$Now$Companion;
public fun <init> (Ljava/lang/Object;)V
public final fun component1 ()Ljava/lang/Object;
public final fun copy (Ljava/lang/Object;)Larrow/eval/Eval$Now;
public static synthetic fun copy$default (Larrow/eval/Eval$Now;Ljava/lang/Object;ILjava/lang/Object;)Larrow/eval/Eval$Now;
public fun equals (Ljava/lang/Object;)Z
public fun getValue ()Ljava/lang/Object;
public fun hashCode ()I
public fun isInitialized ()Z
public fun memoize ()Larrow/eval/Eval;
public fun toString ()Ljava/lang/String;
public fun value ()Ljava/lang/Object;
}

public final class arrow/eval/Eval$Now$Companion {
public final fun getUnit ()Larrow/eval/Eval;
}

public final class arrow/eval/EvalKt {
public static final fun iterateRight (Ljava/util/Iterator;Larrow/eval/Eval;Lkotlin/jvm/functions/Function2;)Larrow/eval/Eval;
public static final fun replicate (Larrow/eval/Eval;I)Larrow/eval/Eval;
public static final fun replicate (Larrow/eval/Eval;ILarrow/typeclasses/Monoid;)Larrow/eval/Eval;
public static final fun replicate (Larrow/eval/Eval;ILkotlin/jvm/functions/Function0;Lkotlin/jvm/functions/Function2;)Larrow/eval/Eval;
public static final fun zip (Larrow/eval/Eval;Larrow/eval/Eval;)Larrow/eval/Eval;
public static final fun zip (Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Lkotlin/jvm/functions/Function10;)Larrow/eval/Eval;
public static final fun zip (Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Lkotlin/jvm/functions/Function9;)Larrow/eval/Eval;
public static final fun zip (Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Lkotlin/jvm/functions/Function8;)Larrow/eval/Eval;
public static final fun zip (Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Lkotlin/jvm/functions/Function7;)Larrow/eval/Eval;
public static final fun zip (Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Lkotlin/jvm/functions/Function6;)Larrow/eval/Eval;
public static final fun zip (Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Lkotlin/jvm/functions/Function5;)Larrow/eval/Eval;
public static final fun zip (Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Lkotlin/jvm/functions/Function4;)Larrow/eval/Eval;
public static final fun zip (Larrow/eval/Eval;Larrow/eval/Eval;Larrow/eval/Eval;Lkotlin/jvm/functions/Function3;)Larrow/eval/Eval;
public static final fun zip (Larrow/eval/Eval;Larrow/eval/Eval;Lkotlin/jvm/functions/Function2;)Larrow/eval/Eval;
}

48 changes: 48 additions & 0 deletions arrow-libs/core/arrow-eval/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
@file:Suppress("DSL_SCOPE_VIOLATION")

plugins {
id(libs.plugins.kotlin.multiplatform.get().pluginId)
alias(libs.plugins.arrowGradleConfig.kotlin)
alias(libs.plugins.arrowGradleConfig.publish)
alias(libs.plugins.kotlinx.kover)
alias(libs.plugins.spotless)
}

spotless {
kotlin {
ktlint().editorConfigOverride(mapOf("ktlint_standard_filename" to "disabled"))
}
}

apply(from = property("ANIMALSNIFFER_MPP"))

kotlin {
sourceSets {
commonMain {
dependencies {
api(libs.kotlin.stdlib)
implementation(projects.arrowCore)
}
}

commonTest {
dependencies {
implementation(libs.kotlin.test)
implementation(libs.kotest.assertionsCore)
implementation(libs.kotest.property)
}
}
}

jvm {
tasks.jvmJar {
manifest {
attributes["Automatic-Module-Name"] = "arrow.eval"
}
}
}
}

tasks.withType<Test>().configureEach {
useJUnitPlatform()
}
4 changes: 4 additions & 0 deletions arrow-libs/core/arrow-eval/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Maven publishing configuration
pom.name=Arrow Eval
# Build configuration
kapt.incremental.apt=false
5 changes: 5 additions & 0 deletions arrow-libs/core/arrow-eval/knit.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
knit.package=arrow.eval.examples
knit.dir=src/jvmTest/kotlin/examples/

test.package=arrow.eval.examples.test
test.dir=src/jvmTest/kotlin/examples/autogenerated/
Loading

0 comments on commit 79a791f

Please sign in to comment.