lib.foldl': document eta expansion

This commit is contained in:
Johannes Kirschbauer 2024-03-16 22:58:14 +01:00
parent 9beef9f1ba
commit c8885b86b2
No known key found for this signature in database

View File

@ -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`