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

More List.drop simplifications #270

Closed lue-bird closed 9 months ago

lue-bird commented 9 months ago

Some simplifications from https://github.com/jfmengels/elm-review-simplify/issues/268 and more

List.drop -1 list
--> list

List.drop 3 [ a, b ] -- including List.singleton etc where we can determine the size
--> []

List.drop 2 [ a, b, c ]
--> [ c ]
lue-bird commented 9 months ago

That's just a side effect of using the callWithNonPositiveIntCheckErrorSituation helper. I also wouldn't say that the new message for 0 specifically is better but it's fine in my eyes.