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

Combine literals when using Dict/Set.union #201

Closed jfmengels closed 11 months ago

jfmengels commented 11 months ago

Adds simplifications made possible in #199 for Array.append for Dict.union and Set.union.

Set.union (Set.fromList [ a, b ]) (Set.fromList [ c, d ])
--> Set.fromList [ a, b, c, d ]

-- Note: Order is reversed
Dict.union (Dict.fromList [ a, b ]) (Dict.fromList [ c, d ])
--> Dict.fromList [ a, b, c, d ]
github-actions[bot] commented 11 months ago

The branch can be tried out by running:

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