jfmengels/elm-review-simplify

Simplify `List.filterMap (\foo -> if x then Just foo else Nothing)` to `List.filter (\foo -> x)`

Open

#340 opened on Feb 25, 2025

View on GitHub
 (2 comments) (1 reaction) (0 assignees)Elm (10 forks)github user discovery
enhancementhelp wanted

Repository metrics

Stars
 (22 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Example of things the rule would report:

List.filterMap (\foo -> if x then Just foo else Nothing)
--> List.filter (\foo -> x)

Example of things the rule would not report:

List.filterMap (\foo -> if x then Just (foo + 2) else Nothing)

I am looking for:

  • Someone to implement it with/for me

Contributor guide