-
Notifications
You must be signed in to change notification settings - Fork 108
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
Changing the function composition operator link #64
Comments
I think I agree on all counts. What are some of the other proposals (i.e. why didn't you throw in behind one of the others)? Maybe we could link to a couple. |
(I updated the original issue accordingly.) |
Although, it appears that one has dead links in it, and one of those linked there is the proposal in question I'm requesting to be de-linked. |
I finally found a few decent links to add. (They're really scattered, and not very many of us actually put together a serious gist/repo.) |
As the author of the existing link, of course I disagree. Happy to defend the proposal in full. The crux of the discussion is whether the operator should allow direct async function composition from one or more other async functions. The proposal allows intuitive composition of any of the 4 available function types: functions, async functions, generator functions and async generator functions from other functions, async functions, generator and/or async generator functions. Join the discussion here: TheNavigateur/proposal-pipeline-operator-for-function-composition#3 (comment) |
@TheNavigateur Find me on Gitter (you may need to sign up and search for @isiahmeadows, my username) or ping me via email (me@isiahmeadows.com), and I'll happily explain the issue further. I'd rather explain this one privately why I, and others I've talked to privately, have drawn issue with the way you handled/responded in that thread. |
There's a huge amount to read through here. Can anyone provide a concise summary? |
@littledan There's a lot of noise in the thread, but here's the highlights:
|
OK, let's leave personal issues aside. What should I understand about the issue, as a TC39 champion? |
@littledan An alternative would be to include links to other similar proposals such as mine and the other I linked to. Edit: If you'd prefer, I can close this and re-file a new bug with just that part. |
If this is just a suggestion for the README, can you just PR the change and we can move on? The issues in that repo don't need to spill over here, and shouldn't have any impact on this proposal. |
@littledan nothing related to this proposal - only the sidenote part of the readme. That sidenote section of the readme only exists to point people somewhere else so they don't introduce unnecessary repetitive red-herring issues here. |
The obvious choices are to either say "if you want a function composition operator, that's something else, go find it" or "here's a list of function composition proposals, if that's what you want". The latter may be slightly more effective at preventing people from opening more issues against this repo? Not sure. Given this issue, maybe not. |
@littledan Should async functions introduced into the composition, such as The proposal uses the same principle for generator functions and async generator functions (intuitive piping). 2 reasons: power and bug minimization in accomplishing such tasks in the problem space. Overloading obviously has precedence in |
I think async is potentially in scope; is there a particular concrete proposal I should review more in depth? I agree with keeping function composition out of scope and linking to proposals for it in the readme. Is there a PR which does this? |
@littledan Of course do review https://github.com/TheNavigateur/proposal-pipeline-operator-for-function-composition . Yes of course function composition is out of scope for this pipeline operator proposal. They can peacefully coexist |
@TheNavigateur If you can make a PR against this repo to link to it from the explainer, I can merge that PR. Is there a proposal I should look at for async integration with |> ? |
@littledan It's already linked to in the README of this proposal. As for async with syncFunction1 |> await asyncFunction1 |> syncFunction2 |
OK, if it's already linked, what's the problem? I agree that we shouldn't put composition in this proposal. Are there any more that we should link as alternatives? I'm not sure what you mean about async with |
@littledan Yeah, then I would change it so that |
@isiahmeadows proposed linking to a different composition operator proposal, or, as a fallback option, adding links to alternative proposals. He was floating the idea for comment before issuing a PR. Two alternative proposals are: Isiah's proposal seems solid to me. He started working on it more than a year ago and has been maintaining it actively in the interim. The concern (shared by others) is that the link from the official TC39 pipeline operator proposal gives the appearance of TC39's imprimatur to the currently-linked (and potentially flawed w/r/t to handling Promises and async functions) composition operator proposal. Pinging @simonstaton (the author of the second alternative proposal) for input. |
@TehShrike I would read it as follows: Pass x |> await f |> g Were you thinking of doing it a different way? |
@kurtmilam Just to be clear, the composition proposal doesn't handle promises, only async functions (and generator functions, and async generator functions). It's purely function composition |
OK, if someone makes a PR which has a list of links to proposals, replacing a single link, I'd merge that. |
@littledan I'll give @simonstaton (alternative proposal author) time to respond. I'd like to know whether he plans to maintain his proposal and would like to have it linked from this one before I issue a PR. |
I'm not sure it matters whether he will maintain it. If it's a good idea it can be forked and maintained by anyone interested, as it is a public repo. I've created a pull request anyway, that can be pulled whenever deemed appropriate, either way |
To clarify #64 (comment): async functions are promise-returning functions; so it either handles both or neither. |
@ljharb several people tried patiently (and unsuccessfully) to explain that to @TheNavigateur . The unsuccessful outcome of that conversation is what spurred @isiahmeadows to open this issue. |
@ljharb Obviously async functions are promise-returning functions. But they are not themselves promises. That's all I'm saying. The proposal doesn't support |
@TheNavigateur gotcha; of course you're correct, but it wasn't clear to me based on your earlier statement. To restate: |
@ljharb Just to correct you very slightly, |
@TehShrike That doesn't mean |
By the way, I've added an explanation section called Why treat |
@TheNavigateur in the context of this proposal and thread, it would theoretically apply to a function that returns a thenable. |
@ljharb When I wrote |
@TheNavigateur What you're saying is a possible alternative proposal, but that's not what the current spec text says. |
@littledan You're absolutely right of course, and I realized that immediately upon your response to when I first wrote it. And of course yes, I would simply propose it as the way to do |
@littledan I've created a pull request for the |
I'm closing this bug in favor of the more useful #67. |
Edit: Added links.
Edit 2: Here's a comment clarifying some of the high points of the below thread.
This thread pretty much ruined any and all hopes I had in that particular proposal, where the OP doesn't seem particularly receptive to the criticism he's receiving of his proposal (and I'm not quite convinced he has much command of the subject matter).
Would it be wise at this point to change the function composition operator link to point to another proposal? (Shameless plug: I have my own separate proposal, but mine isn't the only alternative - there's others that are effectively the same thing, including function-based and method-based variants.)
The text was updated successfully, but these errors were encountered: