lib.concatMap and lib.mapAttrs to be builtins

This commit is contained in:
volth
2018-07-05 03:08:00 +00:00
parent 1999d279ec
commit e9a6c7cebb
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -195,8 +195,9 @@ rec {
{ x = "foo"; y = "bar"; }
=> { x = "x-foo"; y = "y-bar"; }
*/
mapAttrs = f: set:
listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set));
mapAttrs = builtins.mapAttrs or
(f: set:
listToAttrs (map (attr: { name = attr; value = f attr set.${attr}; }) (attrNames set)));
/* Like `mapAttrs', but allows the name of each attribute to be