These are chat archives for ramda/ramda

13th
Apr 2019
Tymoteusz Czech
@Tymek
Apr 13 20:18

hi. I don't get something:

const f = cond([
  [equals(  0), always('none')],
  [T,           always(null)],
]);

f(0) // 'none', OK
f(undefined) // null, OK
f() // 'none', ??? what

why calling without argument is different than calling with undefined?

1point7point4
@1point7point4
Apr 13 21:11
arguments.length is different
That means that while equals (0) (undefined) is false...
Tymoteusz Czech
@Tymek
Apr 13 21:13
@1point7point4 thx
1point7point4
@1point7point4
Apr 13 21:13
...equals (0) () returns equals (0), which ends up being a truthy value.
@Tymek yw
A lot of the people who contribute to ramda also contribute to sanctuary, which is another FP utils library with more focus on type safety.