-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lib/attrsets: merge concatMapAttrs recursively #206965
base: master
Are you sure you want to change the base?
lib/attrsets: merge concatMapAttrs recursively #206965
Conversation
I would suggest having an additional |
Also skip ahead to the |
This makes it possible to drop name and just inherit values. concatMapAttrsRecursive (name: value: { inherit (value) a b; }) { foo = { a = { q = null; }; b = { q = null; }; }; bar = { a = { p = null; }; b = { p= null; };};}
f8a1b85
to
a5d9627
Compare
Added the recursive variant, don't really have the time to do a until variant right now. |
/* Same as concatMapAttrs but merges the attrsets recurisvely. | ||
|
||
Type: | ||
concatMapAttrs :: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
concatMapAttrs :: | |
concatMapAttrsRecursive :: |
What are the use cases for such a function? |
I take back my previous comment. A truly recursive Instead of recursion, the new function seems to be about combining attribute values instead of picking one, so I think |
This makes it possible to drop name and just inherit values.
Before the above only returned
{ a = { q = null; }; b = { q = null; }; }
and with that change p is also included.Description of changes
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes