nixpkgs/lib
danbst 69920dafbf lib: introduce foreach = flip map
The main purpose is to bring attention to `flip map`, which improves
code readablity. It is useful when ad-hoc anonymous function
grows two or more lines in `map` application:

```
      map (lcfg:
        let port = lcfg.port;
            portStr = if port != defaultPort then ":${toString port}" else "";
            scheme = if cfg.enableSSL then "https" else "http";
        in "${scheme}://cfg.hostName${portStr}"
      ) (getListen cfg);
```
Compare this to `foreach`-style:
```
      foreach (getListen cfg) (lcfg:
        let port = lcfg.port;
            portStr = if port != defaultPort then ":${toString port}" else "";
            scheme = if cfg.enableSSL then "https" else "http";
        in "${scheme}://cfg.hostName${portStr}"
      );
```
This is similar to Haskell's `for` (http://hackage.haskell.org/package/base-4.12.0.0/docs/Data-Traversable.html#v:for)
2019-07-14 13:29:58 +03:00
..
systems Revert "Revert "systems/doubles.nix: add Apple doubles"" 2019-07-10 15:14:59 -04:00
tests make-tarball / lib-tests: reduce duplication 2019-07-11 18:02:05 +02:00
asserts.nix
attrsets.nix
customisation.nix lib: tiny cleanup 2019-02-03 15:30:15 +00:00
debug.nix
default.nix lib: introduce foreach = flip map 2019-07-14 13:29:58 +03:00
deprecated.nix
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 linux: convert hardened-config to a structured one 2019-01-28 09:07:24 +09:00
licenses.nix licenses: refer to libpng2 using spdx 2019-06-12 22:04:52 +00:00
lists.nix lib: introduce foreach = flip map 2019-07-14 13:29:58 +03:00
meta.nix
minver.nix
modules.nix module system: revert "remove types.optionSet", just deprecate (#56857) 2019-03-07 21:28:09 +02:00
options.nix module system: prettify a bit error when unique option defined twice 2019-06-05 03:10:57 +03:00
sources.nix treewide: Remove usage of isNull 2019-04-29 14:05:50 +02:00
strings-with-deps.nix
strings.nix Doc fix: use correct function name in type signature for concatIMapStringsSep 2019-03-18 12:14:39 +00:00
trivial.nix treewide: Remove usage of isNull 2019-04-29 14:05:50 +02:00
types.nix module system: revert "remove types.optionSet", just deprecate (#56857) 2019-03-07 21:28:09 +02:00
versions.nix
zip-int-bits.nix