These are chat archives for ramda/ramda

May 2015
Scott Sauyet
May 01 2015 02:28

@farzher: would this do it?

R.pipe(R.groupBy(R.prop('domain')), R.mapObj(R.sortBy(R.prop('confidence'))))(contacts)

The domains are not sorted, but the contacts within the domains are sorted by confidence. Is that what your looking for? (

Jethro Larson
May 01 2015 16:34
I think rich hickey's talk on transducers showed them composing backwards so it's probably just a property of them.
Kevin Wallace
May 01 2015 20:35
slightly different argument orders, names and implementations, but transducer composition execution order reversal is basically because of this line:
(ramda's impl the call to xf in transduce is all done on one line)
when you pass in a composition of transformers to transduce
the composition is being executed on that line
all the composed transformers are waiting for their xform argument
Kevin Wallace
May 01 2015 20:41
(they have all receieved the f function already, eg
so before the composition xf is called in transduce
they are here
(ramda curried)
so after xf is called in transduce, the composition has been executed and you now have a transformer stack
here is a minimal jsbin using ramda:,console
scroll to the bottom of the javascript for what is being executed
Kevin Wallace
May 01 2015 20:46
it is difficult to follow in a debugger because of all the currying and other intermediate functions, but it is a good way to see what is going on