Change multiway if layout to keep consistent 2-space indent increase
commitee3c506889ae3396e76a9def6f9a85f40d1c5799
authorYuriy Syrovetskiy <cblp@cblp.su>
dateFri 16 Aug 2019, 11:21 (7 years ago)
parentd0a44c2
data/examples/declaration/value/function/multi-way-if-out.hs+5−4
@@ -3,7 +3,8 @@
33foo x = if | x == 5 -> 5
44
55bar x y =
6− if | x > y -> x
7− | x < y ->
8− y
9− | otherwise -> x
6+ if
7+ | x > y -> x
8+ | x < y ->
9+ y
10+ | otherwise -> x
src/Ormolu/Printer/Meat/Declaration/Value.hs+3−2
@@ -549,8 +549,9 @@ p_hsExpr = \case
549549 breakpoint
550550 inci (p_hsExpr x)
551551 HsMultiIf NoExt guards -> do
552− txt "if "
553− sitcc $ sep newline (located' (p_grhs RightArrow)) guards
552+ txt "if"
553+ breakpoint
554+ inci . sitcc $ sep newline (located' (p_grhs RightArrow)) guards
554555 HsLet NoExt localBinds e -> do
555556 txt "let "
556557 sitcc (located localBinds p_hsLocalBinds)