I'm using the new parZipOrAccumulate function from Arrow 1.2.0-RC to parallelize two calls and accumulate their errors if any:
private suspend fun getUser(legalId: UserLegalId): Either
private suspend fun…
I'm trying to add unit tests to a project that we've inherited from another company, but I can't manage to make them work since I'm not very experienced with testing and I never used the Arrow-kt library.
The function…
I've been using Arrow-KT for a long time now. I'm much newer to coroutines and the programming model around them, this is my first project using them. I've got the following scenario:
Either.catch { funcThatReturnsFlow() }
.map { flow ->
…
Arrow-fx has a type Atomic which is similar to java AtomicRef but with an initial value, which means I don't need to check every time while accessing the atomic value whether it's null.
Here is a simple example
import arrow.fx.coroutines.*
suspend…
In Arrow-kt I'd like to create an alias to the bind() - for a kind of custom lib to use Arrow.
I'd expect the following to work but it doesn't:
suspend fun Either.bindMy(): S = this.bind()
The method I wanna target is
public interface…
I am using Kotlin together with Arrow-Kt libraries.
I am launching on a specific scope some coroutines that make use of Arrow-kt's Schedule.
At a certain time, I want to be able to cancel all those coroutines that were launched on that scope, but…
I'm trying to use arrow analysis in my project to catch exceptions at compile time. I follow this page but when I do Gradle build I get a bunch of runtime exceptions
It's my test code
fun main() {
val wrong = emptyList().get(2)
}
It's my…
I used arrow.kt library so many times, I really enjoyed the features they gave to extend kotlin. I like how Either can represent the success/failed states seamlessly. I am just wondering if arrow.kt has a way to represent loading state along…
I currently face the problem of correctly closing resources that never leave their containing Either.
The relevant code looks something like this:
object SomeError
class MyRes : AutoCloseable { [...] }
fun createRes(): Either {…
I would like to combine a Kotlin extension function on some receiver class Receiver with arrow-kt's either comprehension. In a regular Kotlin extension function, this binds to the receiver object; however, the either-comprehension EitherEffect…
im investigating the io.arrow.kt functional programming library in my current android project.
im having difficulty in configuring the optics module that employs ksp for source code generation
my project gradle resembles this
buildscript {
…
I have class A:
class A (private var z: String, private var y: String, private var x: Int)
I want to create a failsafe builder for it. The builder should return Either the list of Exceptions (e.g. when values are missing) or the created values.…
I need to take 2 values, each of them is Either and combine them together (or to do anything else) if each of the values is Right.
For arrow-kt 0.11.0 it was possible with tupled
tupled(
"Hello".right(),
…
I am currently learning to use ArrowKT and I have the following code for validating an input. I tried to collect all the errors at once and execute the validations in parallel since most of them are done against the database.
return…