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

Dict.filter (\k _ -> k /= foo) => Dict.remove foo #327

Open
miniBill opened this issue Dec 18, 2024 · 1 comment
Open

Dict.filter (\k _ -> k /= foo) => Dict.remove foo #327

miniBill opened this issue Dec 18, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@miniBill
Copy link
Contributor

What the rule should do:
Dict.filter (\k _ -> k /= foo) => Dict.remove foo

What problems does it solve:
Change from O(n) to O(log n) complexity, and reduce memory usage.

Should this be part of the Simplify rule or should it be a new rule?
Part of Simplify

I am looking for:

  • Someone to implement it with/for me
@lue-bird
Copy link
Collaborator

lue-bird commented Dec 19, 2024

also

Set.filter (\k -> k /= needle) set
--> Set.remove needle set

would be nice if a fuzz test can verify these always works with NaN

@lue-bird lue-bird added the enhancement New feature or request label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants