Native Function Composition

Isiah Meadows isiahmeadows at gmail.com
Thu Aug 31 12:38:43 UTC 2017


Just thought I'd throw this out there: I've been off-and-on working on
my own function composition strawman [1] for about a year now [2]. I
decided just now to make some edits to clean up the proposal and
address some other ideas that have come up since (e.g. async
composition).

[1]: https://github.com/isiahmeadows/function-composition-proposal
[2]: https://esdiscuss.org/topic/function-composition-syntax
-----

Isiah Meadows
me at isiahmeadows.com

Looking for web consulting? Or a new website?
Send me an email and we can get started.
www.isiahmeadows.com


On Wed, Aug 30, 2017 at 4:48 AM, Naveen Chawla <naveen.chwl at gmail.com> wrote:
> I've updated my proposal to use `+>` instead of `|>`, based on this
> discussion:
>
> https://github.com/tc39/proposal-pipeline-operator/issues/50
>
> https://github.com/TheNavigateur/proposal-pipeline-operator-for-function-composition
>
> On Sat, 26 Aug 2017 at 13:17 T.J. Crowder <tj.crowder at farsightsoftware.com>
> wrote:
>>
>> On Sat, Aug 26, 2017 at 3:07 AM, Jordan Harband <ljharb at gmail.com> wrote:
>> >
>> > "incompatible" is a very strong and likely incorrect claim. `(sync1 |>
>> > sync2 |> async1).then(x => x |> sync3 |> async2).then(x => async3)` could
>> > work just fine.
>>
>> Or indeed, a robust proposal might allow for async functions in the
>> pipeline (with some indication, so you can look at the code and reason about
>> it; although `then` accepts non-thenable values and you can't tell by
>> looking, so...). Conceptually:
>>
>> ```js
>> let x = sync1 |> sync2 |*> async1 |> sync3 |*> async2 |*> async3;
>> ```
>>
>> -- T.J. Crowder
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>


More information about the es-discuss mailing list