From c100a456b1da162ea010e5880cded268aa68cec6 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 12 Oct 2018 16:51:05 -0400 Subject: nixpkgs docs: document recursivelyUpdateUntil --- doc/functions/library/attrsets.xml | 108 +++++++++++++++++++++++++++++++++++++ 1 file changed, 108 insertions(+) (limited to 'doc/functions') diff --git a/doc/functions/library/attrsets.xml b/doc/functions/library/attrsets.xml index a719b7958458..a6fa2ea0e295 100644 --- a/doc/functions/library/attrsets.xml +++ b/doc/functions/library/attrsets.xml @@ -1563,4 +1563,112 @@ lib.attrsets.zipAttrs ]]> + +
+ <function>lib.attrsets.recursiveUpdateUntil</function> + + recursiveUpdateUntil :: ( [ String ] -> AttrSet -> AttrSet -> Bool ) -> AttrSet -> AttrSet -> AttrSet + + + + + + Does the same as the update operator // except that + attributes are merged until the given predicate is verified. The predicate + should accept 3 arguments which are the path to reach the attribute, a part + of the first attribute set and a part of the second attribute set. When the + predicate is verified, the value of the first attribute set is replaced by + the value of the second attribute set. + + + + + + pred + + + + [ String ] -> AttrSet -> AttrSet -> Bool + + + + + path + + + + The path to the values in the left and right hand sides. + + + + + + l + + + + The left hand side value. + + + + + + r + + + + The right hand side value. + + + + + + + + + lhs + + + + The left hand attribute set of the merge. + + + + + + rhs + + + + The right hand attribute set of the merge. + + + + + + + Recursively merging two attribute sets + { + foo.bar = 1; # 'foo.*' from the second set + foo.quz = 2; # + bar = 3; # 'bar' from the first set + baz = 4; # 'baz' from the second set +} + ]]> + +
-- cgit 1.4.1