From 3b3bde463ba7092dffdb78f20bffff4520e1df76 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 12 Oct 2018 16:02:26 -0400 Subject: nixpkgs docs: document zipAttrsWithNames --- doc/functions/library/attrsets.xml | 88 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) (limited to 'doc') diff --git a/doc/functions/library/attrsets.xml b/doc/functions/library/attrsets.xml index 8206142d7df2..b49ccaf739ac 100644 --- a/doc/functions/library/attrsets.xml +++ b/doc/functions/library/attrsets.xml @@ -1353,4 +1353,92 @@ lib.attrsets.optionalAttrs false { my = "set"; } ]]> + +
+ <function>lib.attrsets.zipAttrsWithNames</function> + + zipAttrsWithNames :: [ String ] -> (String -> [ Any ] -> Any) -> [ AttrSet ] -> AttrSet + + + + + + Merge sets of attributes and use the function f to merge + attribute values. + + + + + + names + + + + A list of attribute names to zip. + + + + + + f + + + + (String -> [ Any ] -> Any + + + Accepts an attribute name, all the values, and returns a combined value. + + + + + name + + + + The name of the attribute each value came from. + + + + + + vs + + + + A list of values collected from the list of attribute sets. + + + + + + + + + sets + + + + A list of attribute sets to zip together. + + + + + + + Summing a list of attribute sets of numbers + { a = "a 11"; b = "b 101"; } + ]]> + +
-- cgit 1.4.1