These are chat archives for ramda/ramda

13th
Jan 2017
Arve Knudsen
@aknuds1
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
@JAForbes
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
@Avaq
Jan 13 2017 12:28
Or even all(identity) if values in the array are already Booleans.
James Forbes
@JAForbes
Jan 13 2017 12:36
And all(equals(true))would work too if you want more precision
Erki Esken
@erkiesken
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
@gabejohnson
Jan 13 2017 14:16
@tehnomaag pathEq and propEq have the same ordering.
Robert Stires
@rjstires
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
@amsross
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
@rjstires
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
@yosbelms
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
@rjstires
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
@yosbelms
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