Merge remote-tracking branch 'origin/master' into stdenv-updates

This commit is contained in:
Eelco Dolstra
2013-03-07 19:33:52 +01:00
121 changed files with 1677 additions and 727 deletions
+12 -1
View File
@@ -194,7 +194,7 @@ rec {
(as: !(as ? "type" && as.type == "derivation"))
(x: ... do something ...)
attrs
*/
*/
mapAttrsRecursiveCond = cond: f: set:
let
recurse = path: set:
@@ -208,6 +208,17 @@ rec {
in recurse [] set;
/* Generate an attribute set by mapping a function over a list of
attribute names.
Example:
genAttrs [ "foo" "bar" ] (name: "x_" + name)
=> { foo = "x_foo"; bar = "x_bar"; }
*/
genAttrs = names: f:
listToAttrs (map (n: nameValuePair n (f n)) names);
/* Check whether the argument is a derivation. */
isDerivation = x: isAttrs x && x ? type && x.type == "derivation";