import { Arr, Fun } from '@ephox/katamari';
const generate = (xs, f) => {
    const init = {
        len: 0,
        list: []
    };
    const r = Arr.foldl(xs, (b, a) => {
        const value = f(a, b.len);
        return value.fold(Fun.constant(b), (v) => ({
            len: v.finish,
            list: b.list.concat([v])
        }));
    }, init);
    return r.list;
};
export { generate };
//# sourceMappingURL=PositionArray.js.map