diff options
author | Marc Weber <marco-oweber@gmx.de> | 2008-12-02 12:26:20 +0000 |
---|---|---|
committer | Marc Weber <marco-oweber@gmx.de> | 2008-12-02 12:26:20 +0000 |
commit | bd0b75fe28d8343e48851422834178cbe999647f (patch) | |
tree | c642c4b126702bf26e7fc03eccf7ec8dbd8076f0 /pkgs/lib/default.nix | |
parent | 1f69d4d1ebb5ecb0ba51c1956df7dac730ae6d87 (diff) | |
download | nixlib-bd0b75fe28d8343e48851422834178cbe999647f.tar nixlib-bd0b75fe28d8343e48851422834178cbe999647f.tar.gz nixlib-bd0b75fe28d8343e48851422834178cbe999647f.tar.bz2 nixlib-bd0b75fe28d8343e48851422834178cbe999647f.tar.lz nixlib-bd0b75fe28d8343e48851422834178cbe999647f.tar.xz nixlib-bd0b75fe28d8343e48851422834178cbe999647f.tar.zst nixlib-bd0b75fe28d8343e48851422834178cbe999647f.zip |
added mergeAttr and concatList functions giving // and ++ a name
svn path=/nixpkgs/trunk/; revision=13542
Diffstat (limited to 'pkgs/lib/default.nix')
-rw-r--r-- | pkgs/lib/default.nix | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pkgs/lib/default.nix b/pkgs/lib/default.nix index e03d0be27d62..21b0c5f68357 100644 --- a/pkgs/lib/default.nix +++ b/pkgs/lib/default.nix @@ -81,8 +81,8 @@ rec { # Concatenate a list of lists. - concatLists = - fold (x: y: x ++ y) []; + concatList = x : y : x ++ y; + concatLists = fold concatList []; # Concatenate a list of strings. @@ -636,7 +636,8 @@ rec { # iterates over a list of attributes collecting the attribute attr if it exists catAttrs = attr : l : fold ( s : l : if (hasAttr attr s) then [(builtins.getAttr attr s)] ++ l else l) [] l; - mergeAttrs = fold ( x : y : x // y) {}; + mergeAttr = x : y : x // y; + mergeAttrs = fold mergeAttr {}; attrVals = nameList : attrSet : map (x: builtins.getAttr x attrSet) nameList; |