These are chat archives for ramda/ramda

Jan 2017
Arve Knudsen
Jan 13 2017 10:07
Is there a function for checking whether all elements of a list are true?
I know there’s all, but I’m wondering if there’s a function where I don’t have to pass a predicate
James Forbes
Jan 13 2017 12:22
I don't think so, butall(Boolean)will tell you if all elements are truthy if that helps.
Aldwin Vlasblom
Jan 13 2017 12:28
Or even all(identity) if values in the array are already Booleans.
James Forbes
Jan 13 2017 12:36
And all(equals(true))would work too if you want more precision
Erki Esken
Jan 13 2017 13:13
argh. why is pathEq arg ordering different from pathOr, propEq, propOr? had to spend time chasing down a bug because of this unusal arg ordering :/
Gabe Johnson
Jan 13 2017 14:16
@tehnomaag pathEq and propEq have the same ordering.
Robert Stires
Jan 13 2017 19:19
While these two have the same result, is there a particular reason or another to do one over the other?
var normalizeContentTypeId = R.evolve({ contentTypeId: parseInt });
var normalizeContentTypeId = R.over( R.lensProp('contentTypeId'), parseInt);
Matt Ross
Jan 13 2017 19:26
off the top of my head, I would say you can expand evolve more easily
if you had many properties and maybe wanted a config object
not that you couldn’t just compose a bunch of overs
<- not an authority
Robert Stires
Jan 13 2017 19:27
I was just discussing with some of my FP team, maybe that the lens can be extracted out? In case the key were to ever change in the object, it might be easier to update code in the future?
Yosbel Marín
Jan 13 2017 19:40
@JAForbes How could I name a function that returns a "mutator" (a function that mutates an object)?
someFn:: fn -> mutator
@rjstires Any thought?
Robert Stires
Jan 13 2017 19:44
What is it you're trying to accomplish?
(Leaving PC will respond if not answered when I return)
Yosbel Marín
Jan 13 2017 19:46
I'm making a lib, I'm looking for a name that means "create a new mutator"
Or "return a new mutator"
I'm looking to name that function to something consistent with the functional jargon