We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fantasyland/fantasy-land#50
const { Maybe } = require('monet'); const { curry, last, slice, reverse, reduce, pipe, ap, curryN, map, flip } = require('ramda'); const apF = flip(ap); const liftFN = curry((arity, fn) => { const lifted = curryN(arity, fn); return curryN(arity, (...args) => { const accumulator = map(lifted, last(args)); const apps = pipe(slice(0, -1), reverse)(args); return reduce(apF, accumulator, apps); }); }); const liftF = fn => liftFN(fn.length, fn); const liftF2 = liftFN(2); const liftF3 = liftFN(3); const m2 = Maybe.of(2); const m3 = Maybe.of(3); const m4 = Maybe.of(4); const add = liftF((a, b, c) => a + b + c); console.dir(add(m2, m3, m4));
The text was updated successfully, but these errors were encountered:
feat: add liftFN
f65a52e
Ref #56
feat: add liftF
b475d5d
Implemented.
Sorry, something went wrong.
char0n
No branches or pull requests
fantasyland/fantasy-land#50
The text was updated successfully, but these errors were encountered: