map
The given function is applied if this is a Right.
Example:
import arrow.core.*
fun main() {
Either.Right(12).map { "flower" } // Result: Right("flower")
Either.Left(12).map { "flower" } // Result: Left(12)
}
Content copied to clipboard
The given function is applied if this is a Right.
Example:
import arrow.core.*
fun main() {
Either.Right(12).map { "flower" } // Result: Right("flower")
Either.Left(12).map { "flower" } // Result: Left(12)
}