query
On this page

foldAttrs

lib.foldAttrs

Docs pulled from | This Revision | 21 minutes ago


Apply fold functions to values grouped by key.

Inputs

op

A function, given a value and a collector combines the two.

nul

The starting value.

list_of_attrs

A list of attribute sets to fold together by key.

Type

foldAttrs :: (Any -> Any -> Any) -> Any -> [AttrSets] -> Any

Examples

lib.attrsets.foldAttrs usage example

foldAttrs (item: acc: [item] ++ acc) [] [{ a = 2; } { a = 3; }]
=> { a = [ 2 3 ]; }
(lib.attrsets.foldAttrs)

Noogle also knows

Aliases