Conversation
|
👍 (once the build is passing!) |
28d8acd to
386270c
Compare
That was deedpoll scolding me for using |
|
Theres already a name for this which I'm trying to recall -- Found it see lodash/lodash#756 Also, I've found used a method in the past in my own code, but don't see it being useful enough for inclusion 😐 |
|
I like this reversion of apply in the test, so unapply sounds like the correct name g = R.unapply(R.apply(f)) === f;Have a feeling this could be used for #484 |
|
Are you on board, @buzzdecafe? |
|
I'm +0 for this but it should be called spread to align with ES6 |
ramda.js
Outdated
There was a problem hiding this comment.
might be clearer to specify that you will get the function back:
@sig ([*...] -> a) -> (*... -> a)
There was a problem hiding this comment.
Good idea. Updated.
|
ok by me. not quite as powerful as ES6 |
|
"Spreading" is synonymous with
The above is roughly equivalent to: R.apply(f, iterableObj);In my view "apply" is better name for this function than "spread". From Wikipedia:
There's potential for confusion, of course, as JavaScript functions have an I prefer |
386270c to
e0e28fe
Compare
|
ok with the code & docs--thoughts on the name @CrossEye ? |
|
The code is fine... the docs work... either name is definitely better than |
|
One of you could hit the green button. :) |
|
Is that what the green button is for? I get it! 😈 |
I've wanted this confusing function several times in the last month or so. It stewed in the back of my mind while I thought of possible names. Today I decided the placeholder name,
unapply, is in fact the right name, given thef/unapply(apply(f))equivalence.This function could be used to define the identity functions discussed in #511:
R.unapplyis useful for the same reason these identity functions are useful: one can reference specific elements of the arguments object, facilitating composition.R.unapplyis more general, though, so I'm confident other uses will emerge. Even having a function for creating arrays is useful at times: