These are chat archives for ramda/ramda

27th
Jun 2015
Scott Sauyet
@CrossEye
Jun 27 2015 03:17
@asaf-romao: That's usually a sign that your code's about to get very interesting.
Hey, folks, I'm off on a weeks vacation. Have fun without me!
Hardy Jones
@joneshf
Jun 27 2015 06:54
@CrossEye enjoy!
Stefano Vozza
@svozza
Jun 27 2015 08:38
are the docs for R.ap right? They seem to imply that it only works with lists but obviously ap is much more than that and with the dispatching in there it works with any functor.
Michael Hurley
@buzzdecafe
Jun 27 2015 13:00
@svozza not quite any functor, right? has to be an Apply to work with ap. At the time those docs were written, i thought it was best to focus on list applications, since that is all that is explicitly supported by the main lib. now i think it might be smart to illustrate the broader use of such functions, as we recently did with commute. see: ramda/ramda#1203
Stefano Vozza
@svozza
Jun 27 2015 13:29
yeah, i think that's a good idea. btw, is ap related to lift somehow? They seem quite similar.
Raine Virta
@raine
Jun 27 2015 13:38

do you think this is stupid?

const setProp = curry((obj, prop, value) => obj[prop] = value);

example usage:

const render = pipe(formatCoords, setProp(document.body, 'innerHTML'));
I knew ramda wouldn't have a function like that but seems handy
Simon Friis Vindum
@paldepind
Jun 27 2015 14:20
@raine So it's like a modifying R.assoc?
Raine Virta
@raine
Jun 27 2015 14:21
yes
Simon Friis Vindum
@paldepind
Jun 27 2015 14:44
I don't think it's stupid. Not in JavaScript.
Tobias Pflug
@gilligan
Jun 27 2015 21:48
evening
could someone help me out suggestion how I could best rewrite this little snippet which uses lodash/transform in ramda ? https://gist.github.com/gilligan/e94d01d3a8b32b087f63