These are chat archives for ramda/ramda

6th
Feb 2017
Lewis
@6ewis
Feb 06 2017 00:14
(I meant reduce*)
Denis Stoyanov
@xgrommx
Feb 06 2017 00:16
@6ewis [...].filter(x => [1,4].includes(x.id))
Brian McKenna
@puffnfresh
Feb 06 2017 00:26
use a lazy list
Lewis
@6ewis
Feb 06 2017 00:36
Let me know if you guys have a better way =)
Denis Stoyanov
@xgrommx
Feb 06 2017 00:40
@puffnfresh lazy list in js?)))) do u mean ES generators?
Brian McKenna
@puffnfresh
Feb 06 2017 00:53
@xgrommx no, just a lazy list
don't need side-effects
Denis Stoyanov
@xgrommx
Feb 06 2017 00:55
@puffnfresh any examples?
Lewis
@6ewis
Feb 06 2017 01:00
@xgrommx I guess he's thinking about using a lib like lazyseq
Myron Mavko
@mmavko
Feb 06 2017 18:02
hi! love Ramda but have some considerations (coming form Clojure bg):
  1. why map is not taking more than 1 collection?
  2. why is there no reduce without "initial accumulator value"?
  3. absence of second, third
  4. absence of simple if: R.if(cond, true_v, false_v)(ok, disputable)
    What do you think guys?
Brad Compton (he/him)
@Bradcomp
Feb 06 2017 18:11
For 4, there's:
R.ifElse
Brad Compton (he/him)
@Bradcomp
Feb 06 2017 18:11
R.when
Brad Compton (he/him)
@Bradcomp
Feb 06 2017 18:11
R.unless
Brad Compton (he/him)
@Bradcomp
Feb 06 2017 18:15
For 3:
R.nth
Matthew Willhite
@miwillhite
Feb 06 2017 18:28
\2. How is reduce going to know what you want to build if you don’t tell it?
Rick Medina
@rickmed
Feb 06 2017 18:36
  1. can you provide an exmaple?
Matthew Willhite
@miwillhite
Feb 06 2017 18:54
@rickmed:
;; map can be used with multiple collections. Collections will be consumed
;; and passed to the mapping function in parallel:
(map + [1 2 3] [4 5 6])
;;=> (5 7 9)
Brad Compton (he/him)
@Bradcomp
Feb 06 2017 18:55
R.zipWith
Brad Compton (he/him)
@Bradcomp
Feb 06 2017 18:56
It doesn't generalize to more than 2 lists, you would need to use ap to do that.
Rick Medina
@rickmed
Feb 06 2017 18:57
^^ that
Brad Compton (he/him)
@Bradcomp
Feb 06 2017 19:00
@ram-bot
zipWith(add, [1, 2, 3], [4, 5, 6])
ram-bot
@ram-bot
Feb 06 2017 19:00
[ 5, 7, 9 ]