genAttrs
lib.genAttrs
Docs pulled from | This Revision | 4 days ago
Generate an attribute set by mapping a function over a list of attribute names.
Inputs
names- 
Names of values in the resulting attribute set.
 f- 
A function, given the name of the attribute, returns the attribute's value.
 
Type
genAttrs :: [ String ] -> (String -> Any) -> AttrSet
Examples
lib.attrsets.genAttrs usage example
genAttrs [ "foo" "bar" ] (name: "x_" + name)
=> { foo = "x_foo"; bar = "x_bar"; }
Noogle detected
Implementation
The following is the current implementation of this function.
genAttrs = names: f: genAttrs' names (n: nameValuePair n (f n));