daily pastebin goal
48%
SHARE
TWEET

Untitled

a guest Nov 19th, 2017 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const curry = fn => (...args) => args.length < fn.length
  2.   ? (...rest) => curry(fn)(...args, ...rest)
  3.   : fn(...args);
  4.  
  5. const applyTo = curry( (x, fn) => fn(x) );
  6.  
  7. const pipe = (headFN, ...restFns) => (...args) => restFns.reduce(applyTo, headFN(...args));
  8. const prop = curry( (key, x) => x[key] );
  9. const equals = curry( (x, y) => x === y );
  10. const startsWith = curry( (str, x) => x.indexOf(str) === 0 );
RAW Paste Data
Top