Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const curry = fn => (...args) => args.length < fn.length
- ? (...rest) => curry(fn)(...args, ...rest)
- : fn(...args);
- const applyTo = curry( (x, fn) => fn(x) );
- const pipe = (headFN, ...restFns) => (...args) => restFns.reduce(applyTo, headFN(...args));
- const prop = curry( (key, x) => x[key] );
- const equals = curry( (x, y) => x === y );
- const startsWith = curry( (str, x) => x.indexOf(str) === 0 );
Add Comment
Please, Sign In to add comment