jfmengels / elm-review-simplify

Provides elm-review rules to simplify your Elm code
https://package.elm-lang.org/packages/jfmengels/elm-review-simplify/latest/
BSD 3-Clause "New" or "Revised" License
20 stars 9 forks source link

Remove List.sortWith on equivalent List.sortWith simplification #214

Closed lue-bird closed 9 months ago

lue-bird commented 9 months ago

The recently added simplification List.sortWith f (List.sortWith f list) --> List.sortWith f list is not correct with for example f = \_ _ -> LT which would reverse the list.

Thanks to Morten Kolstad on slack for finding and explaining this edge case!

github-actions[bot] commented 9 months ago

The branch can be tried out by running:

elm-review --template jfmengels/elm-review-simplify/preview