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

await with pipeline #87

Closed
Alexsey opened this issue Jan 25, 2018 · 1 comment
Closed

await with pipeline #87

Alexsey opened this issue Jan 25, 2018 · 1 comment

Comments

@Alexsey
Copy link

Alexsey commented Jan 25, 2018

There is a problem with await because it's not obvious to when should it be applied - at the stage of declaration or at the stage of execution. Consider code

a |> await f

like should it be

await f(a)

or

(await f)(a)

And while trivial examples would probably prefer the first scenario I think lack of support of second scenario would make the functionality flawed in comparison to .

And even more - the could be

await (await obj.f()).g(a)

And there should be a way to write it with |>

So the proposal is to stand on the first way of resolution a |> await f to await f(a) but add a way to achieve second way. As far as I can understand we need some syntax extension for that because it's impossible with current form of proposal. A few things I can get from the top of my head are:

  1. await |>
    (await f)(a) -> a await |> f
    (await obj.f())(a) -> a (await |> obj.f())
    (await obj.f()).g(a) -> a ((await |> obj.f()) g)
    await (await obj.f()).g(a) -> a (await (await |> obj.f()) g)
  2. awaited
    (await f)(a) -> a |> awaited f
    (await obj.f())(a) -> a |> awaited obj.f()
    (await obj.f()).g(a) -> a |> (awaited obj.f()).g
    await (await obj.f()).g(a) -> a |> await (awaited obj.f()).g

But I'm not standing on any of them and would like to start a discussion about how others are seen the resolution to this problem

@Alexsey
Copy link
Author

Alexsey commented Jan 25, 2018

It looks like I have just set the same discussion as it is #83 so closing this in favor of posting there

@Alexsey Alexsey closed this as completed Jan 25, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant