arrow-streams / arrow.streams.internal / arrow.Kind / foldMap

foldMap

fun <M, S, A> FreeCOf<S, A>.foldMap(f: FunctionK<S, M>, MM: MonadError<M, Throwable>): Kind<M, Option<A>>

Catamorphism for FreeC.

Run to completion, mapping the suspension with the given transformation at each step and accumulating into the monad M.

This method uses tailRecM to provide stack-safety.

Do you like Arrow?

Arrow Org
<