//arrow-core/arrow.core/flatMap

flatMap

common inline fun <A, B, C> Either<A, B>.flatMap(f: (B) -> Either<A, C>): Either<A, C>

Binds the given function across Right.

Parameters

common

   
f The function to bind across Right.

common inline fun <A, B, D> Ior<A, B>.flatMap(SG: Semigroup<A>, f: (B) -> Ior<A, D>): Ior<A, D>

Binds the given function across Ior.Right.

Parameters

common

   
f The function to bind across Ior.Right.

common inline fun <A, B> Result<A>.flatMap(transform: (A) -> Result<B>): Result<B>

Compose a transform operation on the success value A into B whilst flattening Result.

See also

common

   
mapCatching if you want run a function that catches and maps with (A) -> B

common fun <K, A, B> Map<K, A>.flatMap(f: (Map.Entry<K, A>) -> Map<K, B>): Map<K, B>

Do you like Arrow?

Arrow Org
<