Aw, snap! I've written up a much shorter proposal myself. I do think composition should be in-order of call, i.e.
``` const composed = a |> b |> c //c(b(a(f))) ``` Reads "do a `then` b `then` c" The advantage is that no-param calls can also be easily chained using the syntax: ``` const switchOnTheEngineThenDrive = switchOnTheEngine |> drive ``` I also don't think the reverse operator should be allowed. I think it compromises readability and could introduce confusion. I've written my shorter proposal here: https://github.com/TheNavigateur/proposal-pipeline-operator-for-function-composition On Fri, 25 Aug 2017 at 16:56 Naveen Chawla <[email protected]> wrote: > On Fri, 25 Aug 2017 at 12:24 Claude Pache <[email protected]> wrote: > >> >> > Le 24 août 2017 à 23:13, Naveen Chawla <[email protected]> a écrit >> : >> > >> > That's a syntax for calling functions, not creating a composed function >> for being called any time. >> > >> > Personally I don't find that proposal compelling because I don't think >> it saves much code vs current syntax - it only straightens the order and >> replaces () with using |>. >> >> Straightening the order is still a big deal in lengthy expressions. And >> imbalance of nesting parentheses is one of my main sources of syntax errors. >> >> > Yes I think this applies in cases of function composition. My point was > that it doesn't save much code, especially in comparison to allowing `|>` > to be used directly as a function composition operator, which would give > you the linearity you could want, as well as adding a whole dimension of > expressive power to the language, instead of just allowing a re-ordered way > of writing existing syntax. > > >> —Claude >> >>
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

