Coroutines implemented with extensible effects
The yield request: reporting a value of type e and suspending the coroutine. For readability, a coroutine accepts a unit to produce its value.
|Yield a (() -> v)|
Yield a value of type a and suspend the coroutine.
Launch a thread and report its status.
Status of a thread: done or reporting the value of the type a (For simplicity, a co-routine reports a value but accepts unit)
r is the effect we're yielding from.
a is the type that is yielded.
w is the type of the value returned from the
coroutine when it has completed.