flatTap

inline fun <A, B, C> Either<A, B>.flatTap(f: (B) -> Either<A, C>): Either<A, B>(source)

Performs an effect over the right side of the value but maps the original value back into the Either. This is useful for mixing with validation functions.


inline fun <A> Result<A>.flatTap(f: (A) -> Result<Any>): Result<A>(source)

Performs an effect over successes but maps the original value back into the Result. This is useful for mixing with validation functions.