nixpkgs-suyu/lib
Profpatsch 8252861507 lib/trivial: add pipe function
`pipe` is a useful operator for creating pipelines of functions.

It works around the usual problem of e.g. string operations becoming
deeply nested functions.

In principle, there are four different ways this function could be
written:

pipe val [ f1 .. fn ]
pipe val [ fn .. f1 ]
compose [ f1 .. fn ] val
compose [ fn .. f1 ] val

The third and fourth form mirror composition of functions, they would
be the same as e.g. `(f1 << f2 << f3 .. << fn) val`.
However, it is not clear which direction the list should have (as one
can see in the second form, which is the most absurd.

In order not to confuse users, we decide for the most “intuitive”
form, which mirrors the way unix pipes work (thus the name `pipe`).
The flow of data goes from left to right.

Co-Authored-By: Silvan Mosberger <infinisil@icloud.com>
2019-10-21 13:19:16 +02:00
..
systems lib: Add armv7a-linux to doubles.nix 2019-10-01 12:51:57 -04:00
tests lib/trivial: add pipe function 2019-10-21 13:19:16 +02:00
asserts.nix
attrsets.nix lib: fix typo in 'zipAttrsWith' documentation 2019-09-11 19:54:36 +02:00
customisation.nix Fix typo in customisation.nix 2019-09-02 13:39:40 +02:00
debug.nix
default.nix lib/trivial: add pipe function 2019-10-21 13:19:16 +02:00
deprecated.nix treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
fetchers.nix
filesystem.nix
fixed-points.nix lib.converge: optimise 2019-04-17 15:55:57 +01:00
generators.nix treewide: Remove usage of isNull 2019-04-29 14:05:50 +02:00
kernel.nix treewide: remove redundant rec 2019-08-28 11:07:32 +00:00
licenses.nix licenses: refer to curl using spdx 2019-09-22 20:33:44 +00:00
lists.nix Merge master into staging-next 2019-09-06 22:46:05 +02:00
meta.nix
minver.nix
modules.nix Merge pull request #69746 from Infinisil/rem-opt-usage-message 2019-10-02 23:11:41 +02:00
options.nix lib/options: fix path in comment 2019-08-26 02:01:49 +02:00
sources.nix lib.cleanSourceWith: Allow name to be set, optional filter, doc 2019-09-03 10:36:57 +02:00
strings-with-deps.nix
strings.nix
trivial.nix lib/trivial: add pipe function 2019-10-21 13:19:16 +02:00
types.nix Merge branch 'master' into staging 2019-09-02 23:25:24 +02:00
versions.nix lib/versions: expose splitVersion 2019-09-26 17:42:42 +02:00
zip-int-bits.nix