mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-08-25 17:55:21 +00:00
lib: improve implementation of foldAttrs
This commit is contained in:
@@ -832,9 +832,7 @@ rec {
|
||||
*/
|
||||
foldAttrs =
|
||||
op: nul: list_of_attrs:
|
||||
foldr (
|
||||
n: a: foldr (name: o: o // { ${name} = op n.${name} (a.${name} or nul); }) a (attrNames n)
|
||||
) { } list_of_attrs;
|
||||
mapAttrs (name: foldr op nul) (zipAttrs list_of_attrs);
|
||||
|
||||
/**
|
||||
Recursively collect sets that verify a given predicate named `pred`
|
||||
|
||||
Reference in New Issue
Block a user