1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-27 19:46:40 +03:00

attrsets: clarify that mapAttrs maps over *leaf* attrs

This commit is contained in:
Adam Joseph 2023-01-22 15:12:40 -08:00
parent 2d23194179
commit ee00af7a32

View file

@ -480,8 +480,10 @@ rec {
/* Like `mapAttrs`, except that it recursively applies itself to /* Like `mapAttrs`, except that it recursively applies itself to
attribute sets. Also, the first argument of the argument the *leaf* attributes of a potentially-nested attribute set:
function is a *list* of the names of the containing attributes. the second argument of the function will never be an attrset.
Also, the first argument of the argument function is a *list*
of the names of the containing attributes.
Example: Example:
mapAttrsRecursive (path: value: concatStringsSep "-" (path ++ [value])) mapAttrsRecursive (path: value: concatStringsSep "-" (path ++ [value]))