weave and weaveWith (#465)

Added weave and weaveWith from tidal
This commit is contained in:
Alex McLean 2023-02-18 00:00:18 +00:00 committed by GitHub
parent cbae355896
commit fdb76867a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 84 additions and 8 deletions

View file

@ -206,3 +206,9 @@ export function parseFractional(numOrString) {
}
export const fractionalArgs = (fn) => mapArgs(fn, parseFractional);
export const splitAt = function (index, value) {
return [value.slice(0, index), value.slice(index)];
};
export const zipWith = (f, xs, ys) => xs.map((n, i) => f(n, ys[i]));