These are chat archives for ramda/ramda

Dec 2017
Dec 18 2017 00:53

new question. why does the following not work:

const d = [{a: 1, b: 99}, {a: 3}, {a: 2, b: 1}]
sortBy(prop('a'), d) // => [{"a": 1, "b": 99}, {"a": 2, "b": 1}, {"a": 3}]
converge(sortBy, [prop, identity])('a', d) // => ["a"] why not the same as line above??

Nm, you just need useWith here: useWith(sortBy, [prop, identity])('a', d)
Jawad Ahmad
Dec 18 2017 08:00
Why would you use Ramdajs over Loadash/fp ?
Keith Alexander
Dec 18 2017 11:17
@jawadahmadd I'm not that familiar with lodash-fp, but am I right in thinking that lodash-fp is lodash with all the functions wrapped to be curried, immutable and have the arguments flipped?
So if you want to use the lodash documentation, you have to convert all the function signatures in your head?
Tomáš Konrády
Dec 18 2017 11:59
@jawadahmadd Ramda was first.
Jawad Ahmad
Dec 18 2017 12:25
@tommmyy I am just asking that why RamdaJs is better than lodash/fp?
Keith Alexander
Dec 18 2017 12:28
Maybe it's not - or maybe it depends what your criteria are
But what you can say is, Ramda is designed from the start to follow a particular functional philosophy, and aligns with the fantasyland spec.
Whereas lodash-fp is a mechanical conversion
Jawad Ahmad
Dec 18 2017 13:40
Still not convinced, why should I use RamdaJs. :(
Denis Stoyanov
Dec 18 2017 14:39
@jawadahmadd this is your own preference
Rick Medina
Dec 18 2017 15:08
@jawadahmadd documentation as @kwijibo is a considerable point. I haven't used fp/lodash extensively but I would expect for ramda to have much better integration with algebraic libs (related to fantasy land). In general, fp in lodash is second class citizen. For example, I would expect lower grade discussions regarding fp on its repo (if you were to learn fp techniques, algorithms, etc)
besides a specific situation (is it not a green project?) I would go straight with ramda
Keith Alexander
Dec 18 2017 16:38
how well you understand the library counts for a lot
if you already know lodash, and understand what the fp conversion is doing, that might be a good bet
otherwise, the ramda docs, repl, this gitter channel etc, are pretty useful for understanding ramda
Keith Alexander
Dec 18 2017 17:04
worth looking at Sanctuary too IMO
Michael Hurley
Dec 18 2017 17:32
or reason, or elm ...
Keith Alexander
Dec 18 2017 17:33
Johnny Hauser
Dec 18 2017 23:52
Does anyone know of an FRP operator that takes a stream that emits a collection and returns a collection of streams that emit a corresponding value from the emitted collection?
streamOfCollections    // => { foo: 123, bar: 456 }
const { foo, bar } = someOperator( [ 'foo', 'bar' ], streamOfCollections)
foo // => 123
bar // => 456
Johnny Hauser
Dec 18 2017 23:58
or help naming it is much appreciated :)