These are chat archives for ramda/ramda

27th
Sep 2015
Martin Algesten
@algesten
Sep 27 2015 09:53 UTC
Does R.converge have an equivalent in haskell?
or lodash?
Raine Virta
@raine
Sep 27 2015 09:59 UTC
jdalton has been working on adding it to lodash
Martin Algesten
@algesten
Sep 27 2015 10:00 UTC
i'm starting to really dig it.
Raine Virta
@raine
Sep 27 2015 10:02 UTC
not a big fan of it
Martin Algesten
@algesten
Sep 27 2015 10:02 UTC
how come?
Raine Virta
@raine
Sep 27 2015 10:03 UTC
usually i find lambdas read better
Martin Algesten
@algesten
Sep 27 2015 10:08 UTC
the specific situation for it i found is when dealing with multiple part operations and wanting to bring the result back into one context as a final step. say. i have a web request, with a request object, and then two database lookups in parallell and i want to bring the total result together as a final step.
lookupProgram = R.pipe(R.path(['query','programId']),dblookup1);
lookupExercise =  R.pipe(R.path(['query','exerciseId']),dblookup2);
altogether = (req, program, exercise) => ... context here...
todo = R.converge(altogether, R.always, lookupProgram, lookupExercise);
todo(req);
Martin Algesten
@algesten
Sep 27 2015 11:37 UTC

Which is clearer?

R.always('program')

or

()=>'program'
Raine Virta
@raine
Sep 27 2015 11:41 UTC
i usually go with always('program')
Martin Algesten
@algesten
Sep 27 2015 11:41 UTC
do you have a motivation or just "it feels good"? ;)
Raine Virta
@raine
Sep 27 2015 11:46 UTC
no particularly rational reason
Raine Virta
@raine
Sep 27 2015 17:06 UTC
perhaps a bit verbose but kind of nice https://gist.github.com/ae658e489421e2ec970e
Scott Sauyet
@CrossEye
Sep 27 2015 17:14 UTC
That is very nice.
Raine Virta
@raine
Sep 27 2015 18:32 UTC
Scott Sauyet
@CrossEye
Sep 27 2015 18:44 UTC
Useful, as always!
David Chambers
@davidchambers
Sep 27 2015 22:43 UTC
@raine, it would be nice to alphabetize the imports.
Cool tool, by the way!
Raine Virta
@raine
Sep 27 2015 22:44 UTC
good idea