https://kotlinlang.org logo
#arrow
Title
# arrow
r

raulraja

05/21/2018, 5:38 PM
@tginiotis I think this alternative is a more common use case which in general threads the effects contained in a list gathering results. That is traversing over the identity of each of the contained effects:
Copy code
val errorOrResults: Either<String, List<Int>> = 
  listOf(1.right(), 2.right(), "not a number".left()).k()
    .sequence(Either.applicative()).fix()
//Left("not a number")
🔝 1