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

operations on list containing absorbing element #257

Closed lue-bird closed 9 months ago

lue-bird commented 9 months ago

when expectNaN is not enabled

List.product [ a, 0, b ]
--> 0

which is a simplification from https://github.com/jfmengels/elm-review-simplify/issues/127

when expectNaN is enabled

List.sum [ a, 0 / 0, b ]
--> 0 / 0

List.product [ a, 0 / 0, b ]
--> 0 / 0
jfmengels commented 9 months ago

Very nice simplifications!