-
Notifications
You must be signed in to change notification settings - Fork 7
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
Composing Compositional Functions #4
Comments
in a perfect world that there would be exactly the number of composition functions that there are asynchronous primitives. The composition function is intended to be the auto-flattening mondic bind for a scalar async type. Under the circumstances I feel as though allowing composition functions to be composed would promote anti-patterns in which composition functions are used for things that decorators should be used for. |
If all this proposal aims to solve (and I think it can solve more) is await for async primitives other than promises - you probably wait to explain why exposing a |
That's a completely reasonable approach. Unfortunately it does not cover the following case: async function(){ A developer may simply decide that they want to build a function which is asynchronous, and then later on compose it together using other asynchronous primitives. It is not necessarily a good experience to force the appearance of an await statement A developer may simply decide that they want to build a function which is asynchronous, and then later on make compose it together using other asynchronous primitives. It is not necessarily a good experience to force the appearance of an await statement. |
FYI, I will bring your then idea up as an alternate proposal. In all likelihood we would use a symbol, but the general idea would be the same. |
I assume this is a response to "why decorators when we can solve more". I agree that forcing async function get(){
return 1;
} Should work no matter what proposal ES ends up getting (like in C#). I'm just saying that the potential for language betterment here is huge if we can work out the semantics here.
Thanks, I'd appreciate it. To clarify: I think it should be explained in the proposal itself (pros and cons vs hooking on |
since the decoration is static and async is a fn, you could always perform wrapping:
not the prettiest, but practical |
This proposal was a really good idea in retrospec - shame nothing happened with it :( |
No pun intended.
In the issue about use cases here we were wondering how compositional functions... compose.
If we have an
async
composer and acached
composer (memoizing) doingasync cached
andcached async
would mean two different things. I can't figure out if the use case of composing compositional functions that'd need theawait
hook is something we can or should do.How should
await
be handled in cases likeobservable async foo(){
? Should the syntax even be allowed? If not, should we provide acompose
function (or similar) that'd delegate between compositions?The text was updated successfully, but these errors were encountered: