diff --git a/lib/lists.nix b/lib/lists.nix index abd9aceed0e3..7fb9d21a1f2e 100644 --- a/lib/lists.nix +++ b/lib/lists.nix @@ -6,8 +6,9 @@ let inherit (lib.strings) toInt; inherit (lib.trivial) compare - min id + min + seq warn ; inherit (lib.attrsets) mapAttrs attrNames attrValues; @@ -276,11 +277,14 @@ rec { ::: */ foldl' = + let + inherit (builtins) foldl'; + in op: acc: # The builtin `foldl'` is a bit lazier than one might expect. # See https://github.com/NixOS/nix/pull/7158. # In particular, the initial accumulator value is not forced before the first iteration starts. - builtins.seq acc (builtins.foldl' op acc); + seq acc (foldl' op acc); /** Map with index starting from 0