<@U8TTZTLJ1> note you don't have to manually use `...
# arrow
r
@JasonB note you don't have to manually use
Either.applicative<L>.map
. You can just import the Applicative projected extensions for any data type that supports it.
Copy code
import arrow.core.extensions.either.applicative.map

val first = 1.right()
val second = 1.right()
val third = RuntimeException().left()

map(first, second, third) { (a, b, c) -> 
  a + b + c
} //Left(RuntimeException)

map(first, second) { (a, b) -> 
  a + b 
} //Right(2)
Additionally if you just want the tupled results and require no further transformations you can use
tupled
instead of `map`:
Copy code
import arrow.core.extensions.either.applicative.tupled

val first = 1.right()
val second = 1.right()
val third = RuntimeException().left()

tupled(first, second, third) //Left(RuntimeException)

tupled(first, second) //Right(Tuple2(1, 1))
👍 1
🤩 1