Skip to content

Commit 1042bbc

Browse files
authored
explainer: Create § Function helpers, edit § split mix
This partially addresses #221. See also #202.
1 parent b1f040f commit 1042bbc

File tree

1 file changed

+41
-5
lines changed

1 file changed

+41
-5
lines changed

README.md

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -826,8 +826,30 @@ context
826826

827827
## Relationships with other proposals
828828

829-
### Partial-function-application syntax
829+
### `Function` helpers
830+
Hack pipes can and would coexist with the [`Function` helpers proposal][helpers],
831+
including its `pipe` and `flow` functions.
832+
These simple (and commonly downloaded) convenience functions
833+
manipulate unary functions without extra syntax.
834+
835+
[helpers]: https://github.com/js-choi/proposal-function-helpers
836+
837+
The pipe champion group has presented F# pipes for Stage 2 twice to TC39,
838+
being unsuccessful both times
839+
due to pushback from multiple other TC39 representatives’
840+
memory performance concerns, syntax concerns about await,
841+
and concerns about encouraging ecosystem bifurcation/forking.
842+
(For more information, see the [proposal history][].)
843+
844+
Given this reality, TC39 is considerably more likely to pass
845+
`pipe` and `flow` helper functions than a similar syntactic operator.
830846

847+
Standardized `pipe` and `flow` convenience functions
848+
may also obviate some of the need for a F#-pipe infix operator.
849+
(They would not preclude standardizing an equivalent operator later.
850+
For example, TC39 standardized binary `**` even when `Math.pow` existed.)
851+
852+
### Partial-function-application syntax
831853
Hack pipes can coexist with a syntax for **partial function application** (PFA).
832854
There are two approaches with which they may coexist.
833855

@@ -928,16 +950,30 @@ would be equivalent to `value |?> await foo(^) |?> ^ + 1`.
928950

929951
### Tacit unary function application
930952
**Tacit unary function application** – that is, F# pipes –
931-
could still be added to the language with **another pipe operator** `|>>`
932-
similarly to how [Clojure has multiple pipe macros][Clojure pipes]
933-
`->`, `->>`, and `as->`.
953+
could still be added to the language in two ways.
934954

935-
[Clojure pipes]: https://clojure.org/guides/threading_macros
955+
First, it can be added as a convenience function `Function.pipe`.
956+
This is what the [the function-helpers proposal][helpers].
936957

958+
Secondly, it can be added as **another pipe operator** `|>>`
959+
similarly to how [Clojure has multiple pipe macros][Clojure pipes]
960+
`->`, `->>`, and `as->`.\
937961
For example, `value |> ^ + 1 |>> f |> g(^, 0)`\
938962
would mean `value |> ^ + 1 |> f(^) |> g(^, 0)`.
939963

964+
[Clojure pipes]: https://clojure.org/guides/threading_macros
965+
940966
There was an [informal proposal for such a **split mix** of two pipe operators][split mix],
941967
which was set aside in favor of single-operator proposals.
942968

943969
[split mix]: https://github.com/tc39/proposal-pipeline-operator/wiki#proposal-3-split-mix
970+
971+
The pipe champion group has presented F# pipes for Stage 2 twice to TC39,
972+
being unsuccessful both times
973+
due to pushback from multiple other TC39 representatives’
974+
memory performance concerns, syntax concerns about await,
975+
and concerns about encouraging ecosystem bifurcation/forking.
976+
(For more information, see the [proposal history][].)
977+
978+
Split mix might return as a proposal after Hack pipes, but it is much more likely
979+
that [`Function.pipe` would get standardized instead][helpers].

0 commit comments

Comments
 (0)