Conversation
|
@roberth can you tell me, if that lib function makes sense. If i should continue and add unit tests at ./lib/tests/misc.nix Maybe i missed it and that functionality is already provided by some other function ? Although i didn't really find one, that's why i created this PR. |
roberth
left a comment
There was a problem hiding this comment.
The general idea is good; just need to make it a bit more consistent with what we have.
|
You could think of corner cases and the behavior we would like there. The initial value is not needed when the function is constant. You could define Also the accumulator doesn't have to be an attrset, and the initial value doesn't have to be "empty". The initial value goes first. |
roberth
left a comment
There was a problem hiding this comment.
Just some doc suggestions. Otherwise lgtm.
9a6d4cb to
ff91c42
Compare
roberth
left a comment
There was a problem hiding this comment.
If you could squash the commits after fixing the type, I think this one is good to go!
- provide comprehensive example - add unit test
f081c4a to
15a8d05
Compare
|
Thanks! |
|
Nice! That's how I always expected |
Description of changes
Add new / missing lib function.
Handy shortcut for iterating over entries in an attrset and collecting the result in an accumulator.
Just like builtins.foldl', but for attrsets
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/)