onSome
The given function is applied as a fire and forget effect if this is a some
. When applied the result is ignored and the original Some value is returned
Example:
import arrow.core.Some
import arrow.core.none
fun main() {
Some(12).onSome { println("flower") } // Result: prints "flower" and returns: Some(12)
none<Int>().onSome { println("flower") } // Result: None
}
Content copied to clipboard