tap

inline fun tap(f: (A) -> Unit): Option<A>

Deprecated

tap is being renamed to onNone to be more consistent with the Kotlin Standard Library naming

Replace with

onSome(f)

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).tap { println("flower") } // Result: prints "flower" and returns: Some(12)
none<Int>().tap { println("flower") } // Result: None
}