es-papp
es-papp copied to clipboard
Rename this method "papply"
This method is pretty much a variant of apply, so it is good to give it a more meaningful name
Even more taking into account that
- you'll find nothing relevant for papp on google
- the "papply" name is already the one used on wikipedia: https://en.wikipedia.org/wiki/Partial_application
otherwise, Clojure on its side name it "partial"
The fact that papp
is not on google is a good thing! If the proposal gets accepted, a google search for papp
will take you straight to the relevant docs.
I argue papp
has equal meaning to papply
due to the word's blank cognitive slate and its direct abbreviation of partial application
.
But alas, we bikeshed :) I guess my main argument to prefer papp
is the practical brevity – practical as in: although it's short, it's not too short, since it's uniquely identifiable and easy to google.
What would you name the theoretical right-side partial application if papply
were chosen?
The fact that papp is not on google is a good thing! If the proposal gets accepted, a google search for papp will take you straight to the relevant docs.
so would javascript papply ;)
I argue papp has equal meaning to papply due to the word's blank cognitive slate
well "app" made me first think about "application" but in JS "application" made me think more about "html5 application manifest" than to function application, while I think every JS developper is meant to known what "apply()" is about
What would you name the theoretical right-side partial application if papply were chosen?
The same we have reduce() & reduceRight() on Arrays, we can perfectly have pApply() & pApplyRight()
I like API consistency within a language. As a former PHP developer, I was horrified how its different API names were not consistent and then so hard to guess or remember...
so would javascript papply ;)
Right, that's precisely my point – there's no difference either way.
"app" made me first think about "application"
Given zero context, I could see that being true, just as I could see "apply" being mistaken for applying for a job application. However, given a context such as as pluck.papp(['name', 'score'])
, I don't imagine anyone mistaking papp
for "html application".
I did not know about Array.prototype.reduceRight
! 😄 Given that, pappRight
might make sense for right-side partial application, if that were also to be included.
Array.prototype.redudeRight
is ultra rear case method while papp
and it's 'right' analog may be used as often as an operator (see The Pipeline Operator proposal that is based on corresponding Haskell operators) as long as you are writing in functional style. If it would be something like papplyRight
it would be really uncomfortable and hard to use
@AMorgaut would you close this issue in favor of #6?
@Mouvedia yep, if "partial" is preferred, why not It's still more explicit than papp I added a reference to "Partial application" from the Wikipedia Partial page