jfmengels/elm-review-simplify

Simplify `if x then True else y` to `x || y`

Open

#12 aperta il 19 lug 2021

Vedi su GitHub
 (8 commenti) (0 reazioni) (0 assegnatari)Elm (10 fork)github user discovery
enhancementhelp wanted

Metriche repository

Star
 (22 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

Stumbled across it in my (old, shameful) code the other day, but the following simplifications could be added:

if foo then
    True
else
    bar

to

foo || bar

and similarly

if foo then
    bar
else
    False

to

foo && bar

Should be easy to implement if you agree they should be, but don't want to put time into it if you disagree. :smile:

Guida contributor