I'm trying to refactor this function to be pointfree.
function siblings(me) {
return R.pipe(family, R.reject(equalsMe(me)))(me);
}
I'd like to pass me
to a function down the pipe along with the value that family
returns.
Tried a few things with R.useWith
or R.converge
with R.identity
or R.__
(not even sure if I should be using that) but found nothing to work.
If I understand correctly
family
is a function that takes a person and returns a list of family members (including that person) e.g.Then you want to create a function
siblings
which takes a person and returns only their siblings e.g.Personally I think your function would read slightly better if it was written this way:
If you really wanted a pointfree version of it, you could use
converge
but I really don't think it is any better: