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

Add reverse on wrapped simplifications #153

Closed lue-bird closed 12 months ago

lue-bird commented 12 months ago

Implements #143 including your comment.

List.reverse [ a ]
--> [ a ]

-- not in summary for example
List.reverse << List.singleton
--> List.singleton

String.reverse (String.fromChar a)
--> String.fromChar a

-- not in summary
String.reverse << String.fromChar
--> String.fromChar

As an unrelated extra, adds the missing List.reverse [] --> [] to the summary.