jfmengels/elm-review-simplify

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

Open

#12 创建于 2021年7月19日

在 GitHub 查看
 (8 评论) (0 反应) (0 负责人)Elm (10 fork)github user discovery
enhancementhelp wanted

仓库指标

Star
 (22 star)
PR 合并指标
 (PR 指标待抓取)

描述

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:

贡献者指南