These are chat archives for ramda/ramda

3rd
Jan 2017
Keith Alexander
@kwijibo
Jan 03 2017 13:26
is there a ramda function for renaming a property of an object?
mmm, R.evolve({foo: R.prop('bar')}) I guess
Tushar Mathur
@tusharmath
Jan 03 2017 15:44
const fn = (action, a) => {
   const b = F0(action, a)
   const c = F1(action, b)
   const d = F2(action, c)
   return d
}
Need some help in making this function point free.
It's kind of like compose, but not exactly
Denis Stoyanov
@xgrommx
Jan 03 2017 15:54
make F(0..2) like action => c => ... and use compose with compose(F2(action), F1(action), F0(action))
Tushar Mathur
@tusharmath
Jan 03 2017 16:15
@xgrommx fn won't be point free right?
Hardy Jones
@joneshf
Jan 03 2017 22:08
@tusharmath what you're writing there is the imperative version of Chain for functions.
So you might be able to do something with pipeK if ramda does a thing for functions and Chain.
Though you'd probably have to change around the order of the function arguments.
Hardy Jones
@joneshf
Jan 03 2017 22:17
Or you could find something like https://github.com/fantasyland/fantasy-readers or similar, and use that.
In the end, you'd have something like const fn = (action, a) => R.pipeK(F0, F1, F2)(a)(action) or such.
Hardy Jones
@joneshf
Jan 03 2017 22:31
@ram-bot
const fn = (action, a) => pipeK(F0, F1, F2)(a)(action);

const F0 = a => action => `(a: ${a}, action: ${action})`
const F1 = b => action => `(b: ${b}, action: ${action})`
const F2 = c => action => `(c: ${c}, action: ${action})`

fn(2, 1);
ram-bot
@ram-bot
Jan 03 2017 22:31
pipeK(...)(...) is not a function
Hardy Jones
@joneshf
Jan 03 2017 22:31
beh
@ram-bot
const fn = (action, a) => R.pipeK(F0, F1, F2)(a)(action);

const F0 = a => action => `(a: ${a}, action: ${action})`
const F1 = b => action => `(b: ${b}, action: ${action})`
const F2 = c => action => `(c: ${c}, action: ${action})`

fn(2, 1);
ram-bot
@ram-bot
Jan 03 2017 22:31
R.pipeK(...)(...) is not a function
Hardy Jones
@joneshf
Jan 03 2017 22:32
wat the wat?
Or if you don't want to curry stuff: https://goo.gl/Id3MvA
Denis Stoyanov
@xgrommx
Jan 03 2017 22:50
@joneshf looks like it is a part of Reader monad but just for monad like a Function