These are chat archives for ramda/ramda

13th
Apr 2018
Jorge Colon
@2upmedia
Apr 13 2018 00:15
@2upmedia your codereview is here https://goo.gl/Ccv6Kg
@tommmyy thank you!
is o() unique to Ramda?
Brad Compton (he/him)
@Bradcomp
Apr 13 2018 18:24
@2upmedia The name o might be unique (it's a play on Haskell's compose operator). Sanctuary has the same function, but they call it compose. It is a common function in other languages. Obviously compose in Ramda is used from the variadic version, and so they had to come up with something else for the strict compose.
Galileo Sanchez
@galileopy
Apr 13 2018 20:19
is there a ramda function that wil take object { key: fn} and return a function that wil take 2 objects and apply the function with the values each key has in each object?
const addObj = X( { a: add, b: add})
addObj({ a: 1, b: 2}, {a: 10, b: 20}) // { a: 11, b: 22}
I am so happy to discover that compose has an alias called o, I wil certainly use o instead of compose from now on
Galileo Sanchez
@galileopy
Apr 13 2018 20:24
although it accepts only one argument :(

mergeWith, solves the simple case

is there a ramda function that wil take object { key: fn} and return a function that wil take 2 objects and apply the function with the values each key has in each object?

Brad Compton (he/him)
@Bradcomp
Apr 13 2018 20:28
R.mergeWithKey
Brad Compton (he/him)
@Bradcomp
Apr 13 2018 20:28
That'll solve cases where you need to differentiate by key, but it isn't as elegant as your solution
solution suggestion