diff --git a/lib/lists.nix b/lib/lists.nix index d8cf8732d239..c162f921280d 100644 --- a/lib/lists.nix +++ b/lib/lists.nix @@ -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`