nixpkgs/pkgs/applications
Danylo Hlynskyi d09b4e3c87
lib: introduce forEach = flip map (#64723)
* 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)

* mass replace "flip map -> foreach"

See `foreach`-introduction commit.
```
rg 'flip map ' --files-with-matches | xargs sed -i 's/flip map /foreach /g'
```

* Revert "mass replace "flip map -> foreach""

This reverts commit 3b0534310c.

* mass replace "flip map -> forEach"

See `forEach`-introduction commit.
```
rg 'flip map ' --files-with-matches | xargs sed -i 's/flip map /forEach /g'
```

* rename foreach -> forEach

* and one more place

* add release notes
2019-08-18 18:47:57 +03:00
..
accessibility/mousetweaks
altcoins Merge master into staging-next 2019-08-17 09:30:16 +02:00
audio mixxx: 2.2.1 -> 2.2.2 2019-08-16 13:54:06 +02:00
backup gdk-pixbuf: rename from gdk_pixbuf 2019-07-22 18:50:57 -04:00
display-managers gdk-pixbuf: rename from gdk_pixbuf 2019-07-22 18:50:57 -04:00
editors elpa-packages: 2019-08-18 2019-08-18 11:10:34 +01:00
gis Merge master into staging-next 2019-07-16 11:15:46 +02:00
graphics Merge master into staging-next 2019-08-17 09:30:16 +02:00
kde kdenlive: add missing dependencies 2019-08-06 10:20:54 -07:00
misc Merge pull request #66757 from kim0/xmrig300 2019-08-18 16:16:27 +02:00
networking Merge branch 'master' into flip-map-foreach 2019-08-18 18:00:25 +03:00
office libreoffice-fresh: 6.2.4.2 -> 6.3.0.4 2019-08-17 10:35:39 -03:00
radio Merge pull request #66342 from markuskowa/upd-gnss 2019-08-12 13:12:42 +02:00
science Merge #65948: tlaplusToolbox: 1.5.7 -> 1.6.0 2019-08-18 10:11:50 +02:00
search [treewide] delete unused patches 2019-05-04 19:52:24 +02:00
version-management tortoisehg: untie from mercurial and update to 5.0.2 (#66173) 2019-08-18 18:28:03 +03:00
video avidemux: 2.7.3 -> 2.7.4 2019-08-17 10:33:37 -07:00
virtualization Merge pull request #66513 from alexbakker/looking-glass-client-b1 2019-08-18 16:20:32 +02:00
window-managers bspwm: 0.9.8 -> 0.9.9 2019-08-17 11:12:35 -07:00