From 655a5fa8bf47e104a50a2e627e1cf234fff1402e Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 12 Oct 2018 16:26:56 -0400 Subject: nixpkgs docs: document zipAttrsWith --- doc/functions/library/attrsets.xml | 79 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) (limited to 'doc/functions/library/attrsets.xml') diff --git a/doc/functions/library/attrsets.xml b/doc/functions/library/attrsets.xml index fe44dfe4f8e..da73e02e056 100644 --- a/doc/functions/library/attrsets.xml +++ b/doc/functions/library/attrsets.xml @@ -1441,4 +1441,83 @@ lib.attrsets.zipAttrsWithNames ]]> + +
+ <function>lib.attrsets.zipAttrsWith</function> + + zipAttrsWith :: (String -> [ Any ] -> Any) -> [ AttrSet ] -> AttrSet + + + + + + Merge sets of attributes and use the function f to merge + attribute values. Similar to where + all key names are passed for names. + + + + + + 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"; c = "c 1001"; } + ]]> + +
-- cgit 1.4.1