From ef05e1057b91647b7c2662437fd658e8b0286e80 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 12 Oct 2018 15:29:09 -0400 Subject: [PATCH] nixpkgs docs: document genAttrs --- doc/functions/library/attrsets.xml | 59 ++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/doc/functions/library/attrsets.xml b/doc/functions/library/attrsets.xml index 7a8ce95fd030..78d05589aa8f 100644 --- a/doc/functions/library/attrsets.xml +++ b/doc/functions/library/attrsets.xml @@ -1172,4 +1172,63 @@ lib.attrsets.mapAttrsRecursiveCond +
+ <function>lib.attrsets.genAttrs</function> + + genAttrs :: [ String ] -> (String -> Any) -> AttrSet + + + + + + Generate an attribute set by mapping a function over a list of attribute + names. + + + + + + names + + + + Names of values in the resulting attribute set. + + + + + + f + + + + String -> Any + + + Takes the name of the attribute and return the attribute's value. + + + + + name + + + + The name of the attribute to generate a value for. + + + + + + + + + + Generate an attrset based on names only + { foo = "x_foo"; bar = "x_bar"; } + ]]> + +