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 record type alias constructor simplifications #278

Closed lue-bird closed 8 months ago

lue-bird commented 8 months ago

Everything left in https://github.com/jfmengels/elm-review-simplify/issues/162 and more

-- given
type alias Record = { first : Int, second : Int }

-- all those that exist for literal records, for example
(if c then Record first second else Record second first).first
--> if c then (Record first second).first else (Record second first).first

.first << Record first
--> always first

.second << Record first
--> identity