'Functional version' broke, cba to fix :)

This commit is contained in:
2023-12-06 01:41:04 +01:00
parent 545f8b4366
commit 74c40576cf
6 changed files with 9 additions and 54 deletions

View File

@@ -1,8 +1,8 @@
// @ts-nocheck
export const pipe = (...fns) => (input) =>
fns.reduce((acc, fn) => fn(acc), input);
export const redFn = (acc, x) => [...acc, x];
export const mapR = (fn) => (input) =>
input.reduce((acc, x) => [...acc, fn(x)], []);