lib.getAttrs: init
This commit is contained in:
parent
0add7e1a47
commit
7b46ccaba5
@ -58,6 +58,10 @@ let out = rec {
|
||||
|
||||
genAttrs' = names: f: listToAttrs (map f names);
|
||||
|
||||
getAttrs = names: set:
|
||||
listToAttrs (map (name: nameValuePair name set.${name})
|
||||
(filter (flip hasAttr set) names));
|
||||
|
||||
setAttr = name: value: set: set // { ${name} = value; };
|
||||
|
||||
optionalTrace = c: msg: x: if c then trace msg x else x;
|
||||
|
Loading…
Reference in New Issue
Block a user