lib/attrsets: merge concatMapAttrs recursively#206965
lib/attrsets: merge concatMapAttrs recursively#206965SuperSandro2000 wants to merge 1 commit intoNixOS:masterfrom
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.
| 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 = trueset 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.shto update generated release notes