tree

fun <A> Program<A>.tree(representatives: Representatives.() -> Unit = {}): Tree(source)

Every path through this program, as its Tree. No handler is applied: a stand-in over the root family answers every effect from its Representatives or its finite response type, an effect with no response ends the path, and the program is replayed from the start once per path, with the answers of the path so far and the next alternative at the branch point. Replaying is what makes this work for program blocks, whose continuations cannot be resumed twice, and it demands that the program be a function of its answers: a replay that meets a different effect than the one recorded at the same position fails, naming both. The program must also finish under every answer.