These are chat archives for ramda/ramda

4th
Feb 2017
diqye
@diqye2014
Feb 04 2017 11:14
pipeK what is "K"
Denis Stoyanov
@xgrommx
Feb 04 2017 11:59
@diqye2014 Kleisli composition. For usual composition u use a -> b type of function but for Kleisli composition u use a -> M b type of function. This is Kleisli arrow
Vasiliy Yorkin
@vyorkin
Feb 04 2017 13:13
it there any difference between these 2 ?
const c0 = pipe(flip(prop)(o), flip(bind)(o));
const c1 = converge(pipe, [flip(prop), flip(bind)])(o);
Vasiliy Yorkin
@vyorkin
Feb 04 2017 13:40
const o = {
  foo() { return this.bar() + 1; },
  bar() { return 1; }
}

const c0 = pipe(flip(prop)(o), flip(bind)(o)); // ok
const c1 = converge(pipe, [flip(prop), flip(bind)])(o); // wtf
const c2 = pipe(...ap([flip(prop), flip(bind)], [o])); // ok
const c3 = apply(pipe, ap([flip(prop), flip(bind)], [o])); // ok

c1('foo')(); // Cannot read property 'bar' of undefined
^ what am I missing here? https://goo.gl/nJsYRq
Vasiliy Yorkin
@vyorkin
Feb 04 2017 14:34
it seems that useWith is the way to go: useWith(pipe, [flip(prop), flip(bind)])(o, o);,
but I still don’t understand whats wrong with using converge in this case