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 String.append simplifications #202

Closed jfmengels closed 11 months ago

jfmengels commented 11 months ago

Same as #199 but for Strings.

I also made

String.append "" str
--> str

String.append (String.fromList [ a, b ]) (String.fromList [ c, d ])
--> String.fromList [ a, b, c, d ]

The same simplification now also works with ++:

String.fromList [ a, b ] ++ String.fromList [ c, d ]
--> String.fromList [ a, b, c, d ]

and ++ with regular lists now (partially) uses the same check.

github-actions[bot] commented 11 months ago

The branch can be tried out by running:

elm-review --template jfmengels/elm-review-simplify/preview
jfmengels commented 11 months ago

The generic building blocks you introduced make this really nice :blush: (when I can find them :sweat_smile: )