mirror of
https://github.com/SebastianWendel/nixpkgs.git
synced 2024-09-19 20:09:01 +02:00
lib.foldl': document eta expansion
This commit is contained in:
parent
9beef9f1ba
commit
c8885b86b2
|
@ -228,7 +228,15 @@ rec {
|
||||||
|
|
||||||
`acc`
|
`acc`
|
||||||
|
|
||||||
: The initial accumulator value
|
: The initial accumulator value.
|
||||||
|
|
||||||
|
The accumulator value is evaluated in any case before the first iteration starts.
|
||||||
|
|
||||||
|
To avoid evaluation even before the `list` argument is given an eta expansion can be used:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
list: lib.foldl' op acc list
|
||||||
|
```
|
||||||
|
|
||||||
`list`
|
`list`
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue