Usando callbacks fica mais simples:
const _for = (step) => (cond, cb, init = 0) => {
const iterate = (i) => {
if (cond(i)) return
cb(i)
iterate(step(i))
}
iterate(init)
}
const times = _for(i => i + 1)
const until = n => i => i >= n
times(until(10), i => times(until(10), j => console.log(i, j)))