flatMapFinished

inline fun <In : Any, Out : Any> Fetch<In>.flatMapFinished(transform: (result: In) -> Fetch<Out>): Fetch<Out>

Transform a finished fetch result.

This is a convenient alias for fold, because only the finished can change the type of the Fetch monad. Attempting to map the other branches necessitates that the finished branch is also mapped due to type constraints.

Receiver

The Fetch to transform.

Return

The transformed Fetch of type Out.

Parameters

In

The type of the Fetch value.

Out

The type of the transformed value.

transform

The lambda to transform the result into an Out.