From e9a6c7cebb62237a523eba804339df6932803459 Mon Sep 17 00:00:00 2001 From: volth Date: Thu, 5 Jul 2018 03:01:13 +0000 Subject: [PATCH] lib.concatMap and lib.mapAttrs to be builtins --- lib/attrsets.nix | 5 +++-- lib/lists.nix | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/attrsets.nix b/lib/attrsets.nix index 19218cfe8ec..dca39cf79ff 100644 --- a/lib/attrsets.nix +++ b/lib/attrsets.nix @@ -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 diff --git a/lib/lists.nix b/lib/lists.nix index 194e1c200ec..231c2317c0c 100644 --- a/lib/lists.nix +++ b/lib/lists.nix @@ -101,7 +101,7 @@ rec { concatMap (x: [x] ++ ["z"]) ["a" "b"] => [ "a" "z" "b" "z" ] */ - concatMap = f: list: concatLists (map f list); + concatMap = builtins.concatMap or (f: list: concatLists (map f list)); /* Flatten the argument into a single list; that is, nested lists are spliced into the top-level lists.