tap

inline fun tap(f: (A) -> Unit): Validated<E, A>(source)

The given function is applied as a fire and forget effect if this is Valid. When applied the result is ignored and the original Validated value is returned

Example:

import arrow.core.Validated

fun main() {
Validated.Valid(12).tap { println("flower") } // Result: prints "flower" and returns: Valid(12)
Validated.Invalid(12).tap { println("flower") } // Result: Invalid(12)
}