mergeAttrsList
lib.mergeAttrsList
Docs pulled from | This Revision | about 9 hours ago
Merge a list of attribute sets together using the //
operator.
In case of duplicate attributes, values from later list elements take precedence over earlier ones.
The result is the same as foldl mergeAttrs { }
, but the performance is better for large inputs.
For n list elements, each with an attribute set containing m unique attributes, the complexity of this operation is O(nm log n).
Inputs
list
-
1. Function argument
Type
mergeAttrsList :: [ Attrs ] -> Attrs
Examples
lib.attrsets.mergeAttrsList
usage example
mergeAttrsList [ { a = 0; b = 1; } { c = 2; d = 3; } ]
=> { a = 0; b = 1; c = 2; d = 3; }
mergeAttrsList [ { a = 0; } { a = 1; } ]
=> { a = 1; }