Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename this method "papply" #5

Open
AMorgaut opened this issue Jun 23, 2016 · 6 comments
Open

Rename this method "papply" #5

AMorgaut opened this issue Jun 23, 2016 · 6 comments

Comments

@AMorgaut
Copy link

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

otherwise, Clojure on its side name it "partial"

@gilbert
Copy link
Owner

gilbert commented Jun 23, 2016

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?

@AMorgaut
Copy link
Author

AMorgaut commented Jun 25, 2016

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...

@gilbert
Copy link
Owner

gilbert commented Jun 27, 2016

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.

@Alexsey
Copy link

Alexsey commented Jun 29, 2016

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

@Mouvedia
Copy link

@AMorgaut would you close this issue in favor of #6?

@AMorgaut
Copy link
Author

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants