Reputation: 10324
Let's call the function f()
.
Examples
f([dec, identity, inc], [3, 2, 1]) // [2, 2, 2]
f([() => 1, append(3)], [[1, 2], [1, 2]]) // [1, [1, 2, 3]]
f([Number, String], ["2"]) // [2, "undefined"]
I am no asking an implementation of f()
, either by writing or composing it with others Ramda functions. I am just asking if such a function already exists in the library and if so, what's its name.
Upvotes: 0
Views: 80
Reputation: 18891
juxt
is close but not exactly what you need:
juxt([f, g, h], 1, 2, 3)
//=> [f(1, 2, 3), g(1, 2, 3), h(1, 2, 3)]
In your case you want zipWith
:
zipWith(call, [dec, identity, inc], [3, 2, 1])
//=> [2, 2, 2]
Upvotes: 3