1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-25 15:11:35 +00:00

Replace fold by all because its more readable and shorter

This commit is contained in:
Marc Weber 2013-08-22 10:16:00 +03:00 committed by Evgeny Egorochkin
parent fcbc4fe9ff
commit 53994036d3

View file

@ -116,7 +116,7 @@ rec {
attrsOf = elemType: mkOptionType {
name = "attribute set of ${elemType.name}s";
check = x: lib.traceValIfNot isAttrs x
&& fold (e: v: v && elemType.check e) true (lib.attrValues x);
&& all elemType.check (lib.attrValues x);
merge = lib.zipAttrsWith (name: elemType.merge);
iter = f: path: set: lib.mapAttrs (name: elemType.iter f (path + "." + name)) set;
fold = op: nul: set: fold (e: l: elemType.fold op l e) nul (lib.attrValues set);