Change function name to if/else
parent
f1b49b082f
commit
cab1297585
|
@ -532,7 +532,7 @@ layoutExpr lexpr@(L _ expr) = do
|
||||||
expDoc1 <- docSharedWrapper layoutExpr exp1
|
expDoc1 <- docSharedWrapper layoutExpr exp1
|
||||||
mBindDocs <- layoutLocalBinds binds
|
mBindDocs <- layoutLocalBinds binds
|
||||||
let
|
let
|
||||||
whenIndentLeftOr x y =
|
ifIndentLeftElse x y =
|
||||||
if indentPolicy == IndentPolicyLeft then x else y
|
if indentPolicy == IndentPolicyLeft then x else y
|
||||||
-- this `docSetIndentLevel` might seem out of place, but is here due to
|
-- this `docSetIndentLevel` might seem out of place, but is here due to
|
||||||
-- ghc-exactprint's DP handling of "let" in particular.
|
-- ghc-exactprint's DP handling of "let" in particular.
|
||||||
|
@ -552,7 +552,7 @@ layoutExpr lexpr@(L _ expr) = do
|
||||||
[ docAlt
|
[ docAlt
|
||||||
[ docSeq
|
[ docSeq
|
||||||
[ appSep $ docLit $ Text.pack "let"
|
[ appSep $ docLit $ Text.pack "let"
|
||||||
, whenIndentLeftOr docForceSingleline docSetBaseAndIndent
|
, ifIndentLeftElse docForceSingleline docSetBaseAndIndent
|
||||||
$ return bindDoc
|
$ return bindDoc
|
||||||
]
|
]
|
||||||
, docAddBaseY BrIndentRegular
|
, docAddBaseY BrIndentRegular
|
||||||
|
@ -562,8 +562,8 @@ layoutExpr lexpr@(L _ expr) = do
|
||||||
]
|
]
|
||||||
, docAlt
|
, docAlt
|
||||||
[ docSeq
|
[ docSeq
|
||||||
[ whenIndentLeftOr id appSep $ docLit $ Text.pack "in "
|
[ ifIndentLeftElse id appSep $ docLit $ Text.pack "in "
|
||||||
, whenIndentLeftOr docForceSingleline docSetBaseAndIndent expDoc1
|
, ifIndentLeftElse docForceSingleline docSetBaseAndIndent expDoc1
|
||||||
]
|
]
|
||||||
, docAddBaseY BrIndentRegular
|
, docAddBaseY BrIndentRegular
|
||||||
$ docPar
|
$ docPar
|
||||||
|
|
Loading…
Reference in New Issue