I’m just starting to work with arrow I use `<ko...
# arrow
h
I’m just starting to work with arrow I use
<kotlin.version>1.5.31</kotlin.version>
but when I use
Copy code
<dependency>
            <groupId>io.arrow-kt</groupId>
            <artifactId>arrow-core</artifactId>
            <version>0.12.1</version>
        </dependency>

        <dependency>
            <groupId>io.arrow-kt</groupId>
            <artifactId>arrow-fx</artifactId>
            <version>0.12.1</version>
        </dependency>
it leads to a warning that there are multiple koltin jars
s
How come you’re using such an old version for Arrow 😮 Can you try
1.0.1
?
That is using Kotlin
1.5.31
The next release this month
1.0.2
will be using Kotlin 1.6.0
h
Awesome .. let me try that !! Arrow-fx doesn't have 1.0.1
s
You want to use
arrow-fx-coroutines
. Sorry
h
that ended having compilation issues
Copy code
tion failure: 
[ERROR] Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath:
[ERROR]     class arrow.core.Either, unresolved supertypes: arrow.Kind
Copy code
either.eager<DomainError, List<Policy>> {
                val piConfigVersion = getConfigVersion(evRequest.configId, evRequest.versionId).bind()
                val isEditable = isEditable(piConfigVersion).bind()
                val incidentAction = addOrUpdateIncidentAction(piConfigVersion, evRequest.ev).bind()
                val updatedIncidentAction = saveIncidentActions(incidentAction).bind()
                val policies = updateScriptBehaviourPolicies(piConfigVersion, evRequest.ev).bind()
                val updatedPolicies = savePolicies(policies).bind()
                updatedPolicies
            }
basically a series of logical steps using bind()
s
And what does your Gradle dependencies config look like?
h
Copy code
<dependency>
            <groupId>io.arrow-kt</groupId>
            <artifactId>arrow-core</artifactId>
            <version>1.0.1</version>
        </dependency>

        <dependency>
            <groupId>io.arrow-kt</groupId>
            <artifactId>arrow-fx-coroutines</artifactId>
            <version>1.0.1</version>
        </dependency>
        <dependency>
            <groupId>io.arrow-kt</groupId>
            <artifactId>arrow-fx-stm</artifactId>
            <version>1.0.1</version>
        </dependency>
Copy code
<kotlin.version>1.6.10</kotlin.version>
s
Ah, I think you need to add a postfix of
-jvm
to your arrow dependencies if you’re using Maven instead of Gradle. You can also use
1.0.0
instead, and from
1.0.2
we will fix Maven support again. We had some issues with releasing Kotlin MPP 😅
1.0.1
and
1.0.0
are codewise identical
👍 1
h
really 😒
let me try that
oh boy…
Copy code
Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: 
public fun <A, B> Either<TypeVariable(A), Iterable<TypeVariable(B)>>.sequence(): List<Either<TypeVariable(A), TypeVariable(B)>> defined in arrow.core
public fun <A, B> Ior<TypeVariable(A), Iterable<TypeVariable(B)>>.sequence(): List<Ior<TypeVariable(A), TypeVariable(B)>> defined in arrow.core
public fun <K, V, G> MapKOf<TypeVariable(K), Kind<TypeVariable(G), TypeVariable(V)>> /* = Kind<Kind<ForMapK, TypeVariable(K)>, Kind<TypeVariable(G), TypeVariable(V)>> */.sequence(GA: Applicative<TypeVariable(G)>): Kind<TypeVariable(G), MapK<TypeVariable(K), TypeVariable(V)>> defined in arrow.core
public fun <A> Option<Iterable<TypeVariable(A)>>.sequence(): List<Option<TypeVariable(A)>> defined in arrow.core
public fun <A, G> SequenceKOf<Kind<TypeVariable(G), TypeVariable(A)>> /* = Kind<ForSequenceK, Kind<TypeVariable(G), TypeVariable(A)>> */.sequence(GA: Applicative<TypeVariable(G)>): Kind<TypeVariable(G), SequenceK<TypeVariable(A)>> defined in arrow.core
public fun <E, A> Validated<TypeVariable(E), Iterable<TypeVariable(A)>>.sequence(): List<Validated<TypeVariable(E), TypeVariable(A)>> defined in arrow.core
that is the compilation error I get