tap Left
The given function is applied as a fire and forget effect if this is a Left. When applied the result is ignored and the original Either value is returned
Example:
import arrow.core.*
fun main() {
Either.Right(12).tapLeft { println("flower") } // Result: Right(12)
Either.Left(12).tapLeft { println("flower") } // Result: prints "flower" and returns: Left(12)
}
Content copied to clipboard