These are chat archives for ramda/ramda

7th
Feb 2018
R.identity
R.identity
R.pickBy
R.pickBy
Mike Lambert
@lax4mike
Feb 07 2018 15:29
there are 6 falsey values in javascript: null, undefined, 0, false, NaN, and "" (empty string)
R.isNil covers null and undefined
Kielan
@Kielan
Feb 07 2018 15:30
how do you get ram-bot to work
Mike Lambert
@lax4mike
Feb 07 2018 15:31
@ram-bot R.isNil
i dunno
R.isNil
Mike Lambert
@lax4mike
Feb 07 2018 15:31
R.isNil
Mike Lambert
@lax4mike
Feb 07 2018 15:32
it seems you just type your function
Mike Lambert
@lax4mike
Feb 07 2018 15:57
is there a github issue or something that is the reasoning behind adding R.o?
Brad Compton (he/him)
@Bradcomp
Feb 07 2018 16:16
Here's the PR for it: ramda/ramda#2127
Not very much there though
Stefano Vozza
@svozza
Feb 07 2018 16:38
one of the big things is that it is curried
surprisingly useful
Mike Lambert
@lax4mike
Feb 07 2018 18:26
why doesn't this work? https://goo.gl/rMoQk3
it works if i replace R.o with R.compose
Vasili Sviridov
@vsviridov
Feb 07 2018 18:37
R.o needs 2 arguments explicitly
i think
Mike Lambert
@lax4mike
Feb 07 2018 18:39
well, R.o can have n arguments, right?
oh, maybe not...
Brad Compton (he/him)
@Bradcomp
Feb 07 2018 18:40
R.o
Mike Lambert
@lax4mike
Feb 07 2018 18:41
R.compose
Mike Lambert
@lax4mike
Feb 07 2018 18:41
i see
ok, next question, when do you use R.o??
Brad Compton (he/him)
@Bradcomp
Feb 07 2018 18:41
It can do stuff you can't do with compose
Mike Lambert
@lax4mike
Feb 07 2018 18:42
like what?
Brad Compton (he/him)
@Bradcomp
Feb 07 2018 18:44
const thenInc = R.o(inc);
const doubleThenInc = thenInc(R.multiply(2));
const halveThenInc = thenInc(R.divide(R.__, 2));
Mike Lambert
@lax4mike
Feb 07 2018 18:45
oh, weird
i see, you can partially apply the first function
Brad Compton (he/him)
@Bradcomp
Feb 07 2018 18:45
const mapAdd = R.o(R.map, R.add);
const mapInc = mapAdd(1);
mapInc([1, 2, 3]);
Oh wait
That one works with compose
OOPS