Unverified Commit 683887a7 authored by Robert Hensing's avatar Robert Hensing Committed by GitHub
Browse files

Merge pull request #212189 from amjoseph-nixpkgs/pr/lib/mapAttrsRecursive/comment

attrsets: clarify that mapAttrs maps over *leaf* attrs
parents 0d16bdba a4e3e162
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -480,8 +480,13 @@ rec {


  /* Like `mapAttrs`, except that it recursively applies itself to
     attribute sets.  Also, the first argument of the argument
     function is a *list* of the names of the containing attributes.
     the *leaf* attributes of a potentially-nested attribute set:
     the second argument of the function will never be an attrset.
     Also, the first argument of the argument function is a *list*
     of the attribute names that form the path to the leaf attribute.

     For a function that gives you control over what counts as a leaf,
     see `mapAttrsRecursiveCond`.

     Example:
       mapAttrsRecursive (path: value: concatStringsSep "-" (path ++ [value]))