diff options
author | Adam Joseph <adam@westernsemico.com> | 2023-01-22 15:12:40 -0800 |
---|---|---|
committer | Adam Joseph <adam@westernsemico.com> | 2023-01-22 15:19:09 -0800 |
commit | ee00af7a32def3d4d9b3e8d7f7f74e053432b9db (patch) | |
tree | eca17bbadda80b010220b181c24b1deffad6f086 /lib | |
parent | 2d231941794df7f2d2fa2f1a0d55e6759c14aef4 (diff) |
attrsets: clarify that mapAttrs maps over *leaf* attrs
Diffstat (limited to 'lib')
-rw-r--r-- | lib/attrsets.nix | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/attrsets.nix b/lib/attrsets.nix index 1a7b90593b1d7..23d4a762f2fb0 100644 --- a/lib/attrsets.nix +++ b/lib/attrsets.nix @@ -480,8 +480,10 @@ 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 names of the containing attributes. Example: mapAttrsRecursive (path: value: concatStringsSep "-" (path ++ [value])) |