-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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: Add more ways to map over/to attrsets #197004
Conversation
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/1463 |
ac28ec3
to
30b1a82
Compare
These functions have been particularly useful while developing nixos modules Co-authored-by: h7x4 <[email protected]>
will be automatically incremented, starting from 0. | ||
|
||
Example: | ||
imapAttrs' (i: name: value: nameValuePair "${name}${toString i}" value + i) |
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.
Both functions have the same signature? If so, what is the difference between them?
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.
they apply f in different places, see the examples:
imapAttrs
has a built in nameValuePair, calling f on just the value, you can't change the names from the input attrset.
imapAttrs'
wants a function that provides a nameValuePair, so you can modify both the name and the value of the input attrset.
I think this is a good change generally, but each function should have:
|
These functions have been particularly useful while developing nixos modules
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