These are chat archives for ramda/ramda

4th
Sep 2017
arian‮
@arian-swydo
Sep 04 2017 06:37
Hi guys, a question about compose order, is it intentional that the order is reversed when using it with into/transduce?
Philipp Wille
@Yord
Sep 04 2017 08:02
@arian-swydo As far as I know, while transducers are evaluated in the correct order, they are executed in reverse order due to their lazy evaluation feature.
arian‮
@arian-swydo
Sep 04 2017 08:21
I'm Probably lacking some understanding here, assuming R.map is a valid transducer, I get different results: https://goo.gl/PY1CWm (links to ramda repl)
Syaiful Bahri
@syaiful6
Sep 04 2017 09:49
that's correct
The clojure version also yields same output, for example thi will output [1 4 7 10 13]
(def xf
  (comp
    (map (partial * 3 ))
    (map inc)
    (take 5)))

(into [] xf (range 1000))
arian‮
@arian-swydo
Sep 04 2017 10:05
interesting, thanks
arian‮
@arian-swydo
Sep 04 2017 11:18
shouldn't these be equal? https://goo.gl/cJ1AY2
Isaac
@IsaacRaja_twitter
Sep 04 2017 15:21
how do i write this
    if (test.length === 1) {
      news = news.length === 1 && news[0] === test[0];
    } else {
      news = test.length > 0 && _.intersection(test, news).length > 0 || false;
    }
in Ramda
especially shortcircuit && operator and testing the first indexes of two array
Philipp Wille
@Yord
Sep 04 2017 20:32
@IsaacRaja_twitter Ramda has several functions acting like && or ||: either, both, anyPass, allPass. Somewhat related in terms of lazy evaluation of their arguments are ifElse, when, unless.
Testing the first indexes of two arrays may be accomplished with: eqProps(0, arr1, arr2)