bind

suspend fun <A> Program<A>.bind(): A(source)

Run this sub-program as the next step of the enclosing block and return its value. A block's continuation is single-shot: binding a multi-shot effect (such as a choice under collectAll) directly in a block fails when it is resumed twice.


suspend fun <R> Effect<R>.bind(): R(source)

Perform this effect as the next step of the enclosing block and return its response. An effect is the one-step program perform makes of it, so effect.bind() is perform(effect).bind(), under the same single-shot rule.