Skip to content
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

builtins.filterAttrs #11888

Open
roberth opened this issue Nov 15, 2024 · 0 comments
Open

builtins.filterAttrs #11888

roberth opened this issue Nov 15, 2024 · 0 comments
Labels
error-messages Confusing messages and better diagnostics feature Feature request or proposal language The Nix expression language; parser, interpreter, primops, evaluation, etc performance

Comments

@roberth
Copy link
Member

roberth commented Nov 15, 2024

Is your feature request related to a problem? Please describe.

  • lib.filterAttrs allocates a list of attribute names twice.

filterAttrs is called every time attrsOf produces a value, and it needs to, because of mkIf.
Plenty of other usages exist.

Describe the solution you'd like

Add builtins.filterAttrs with the same behavior.

Side benefit: stack traces will be slightly shorter without losing info.

Describe alternatives you've considered

Additional context

Priorities

Add 👍 to issues you find important.

@roberth roberth added feature Feature request or proposal error-messages Confusing messages and better diagnostics language The Nix expression language; parser, interpreter, primops, evaluation, etc performance labels Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error-messages Confusing messages and better diagnostics feature Feature request or proposal language The Nix expression language; parser, interpreter, primops, evaluation, etc performance
Projects
None yet
Development

No branches or pull requests

1 participant