3
0
Fork 0
forked from mirrors/nixpkgs

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);