const coroutine = f => {
    const o = f();
    o.next();
    return x => o.next(x);

}

그만 알아봐도 되지?