Replaces the value of an item at the specified index, returning the new iterable set
function updateAt(index, value) {
    return function (source) {
        return __asyncGenerator(this, arguments, function* () {
            var e_31, _a;
            let i = 0;
            try {
                for (var source_2 = __asyncValues(source), source_2_1; source_2_1 = yield __await(source_2.next()), !source_2_1.done;) {
                    const item = source_2_1.value;
                    if (i === index) {
                        yield yield __await(value);
                    }
                    else {
                        yield yield __await(item);
                    }
                    i = i + 1;
                }
            }
            catch (e_31_1) { e_31 = { error: e_31_1 }; }
            finally {
                try {
                    if (source_2_1 && !source_2_1.done && (_a = source_2.return)) yield __await(_a.call(source_2));
                }
                finally { if (e_31) throw e_31.error; }
            }
        });
    };
}