|
|
|
|
|
by packetlost
421 days ago
|
|
I don't think |> really can support applying the result of one of its composite applications in general, so it's not ambiguous. Given this example: (await getFutureAsyncFactory("bar"))("input")
the getFutureAsyncFactory function is async, but the function it returns is not (or it may be and we just don't await it). Basically, using |> like you stated above doesn't do what you want. If you wanted the same semantics, you would have to do something like: ("bar" |> await getFutureAsyncFactory())("input")
to invoke the returned function.The whole pipeline takes on the value of the last function specified. |
|
But the latter is syntactically undistinguishable from
What do you think about Where you don't really call the function with () in the pipeline syntax? I think that would be more natural.