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

filter, then isEmpty is equivalent to not any #297

Open
lue-bird opened this issue Mar 7, 2024 · 0 comments
Open

filter, then isEmpty is equivalent to not any #297

lue-bird opened this issue Mar 7, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@lue-bird
Copy link
Collaborator

lue-bird commented Mar 7, 2024

List.isEmpty (List.filter isOdd list)
--> not (List.any isOdd list)

(strangely, no other published elm/... module exposes both any and filter.)

If we want to save an extra step, we can also introduce separate checks for the negated applications like

not (List.isEmpty (List.filter isOdd list))
--> List.any isOdd list

(found in the FSharpLint default config)

@lue-bird lue-bird added the enhancement New feature or request label Mar 7, 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

1 participant