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 Tuple.first, Tuple.second on tuple simplifications #161

Closed lue-bird closed 12 months ago

lue-bird commented 12 months ago

Tuple.first and Tuple.second simplifications from #2 + some for composition

Tuple.first ( a, b )
--> a

Tuple.second ( a, b )
--> b

-- not shown in summary
Tuple.first (Tuple.pair a b)
--> a

-- not shown in summary
Tuple.second (Tuple.pair a b)
--> b

-- not shown in summary
Tuple.second << Tuple.pair a
--> identity

-- not shown in summary
Tuple.first << Tuple.pair a
--> always a
jfmengels commented 12 months ago

Really nice! That inspired me with new simplifications for records I recorded in https://github.com/jfmengels/elm-review-simplify/issues/162