Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/attrsets.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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]))
Expand Down