mirror of
https://github.com/NixOS/rfcs.git
synced 2025-11-09 03:56:11 +01:00
Update rfcs/0148-pipe-operator.md
Co-authored-by: Robert Hensing <roberth@users.noreply.github.com>
This commit is contained in:
parent
7e43edffa0
commit
1026104d8f
1 changed files with 2 additions and 2 deletions
|
|
@ -248,8 +248,8 @@ having `<|` weaker than `|>` like Haskell's `$` and `&` would be a bad idea.
|
||||||
## Change the `pipe` function signature
|
## Change the `pipe` function signature
|
||||||
|
|
||||||
There are many equivalent ways to declare this function, instead of just using the current design.
|
There are many equivalent ways to declare this function, instead of just using the current design.
|
||||||
For example, one could flip its arguments to allow a partially-applied point-free style (see above).
|
For example, one could flip its arguments so that it becomes function composition on list of functions.
|
||||||
One could also make this a single-argument function so that it only takes the list as argument.
|
Not only can this function trivially replace pipe; it can also be readily used where a function is expected, such as in `map`.
|
||||||
|
|
||||||
The current design of `pipe` has the advantage that its asymmetry points at its operating direction, which is quite valuable.
|
The current design of `pipe` has the advantage that its asymmetry points at its operating direction, which is quite valuable.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue