mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-04-13 07:27:27 +00:00
lib.foldl': document eta expansion
This commit is contained in:
parent
9beef9f1ba
commit
c8885b86b2
@ -228,7 +228,15 @@ rec {
|
||||
|
||||
`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`
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user