on master help sign in
Shift ‘in’ in ‘let’ to the right to allow placing it in do blocks
3d74f2fmrkkrp
data/examples/declaration/value/function/do-out.hs+5
@@ -47,3 +47,8 @@ foo = do
47 print x
47 print x
48 y <- c
48 y <- c
49 print y
49 print y
50+
51+trickyLet = do
52+ foo
53+ let x = 5
54+ in bar x
data/examples/declaration/value/function/do.hs+5
@@ -46,3 +46,8 @@ foo = do
46
46
47 y <- c
47 y <- c
48 print y
48 print y
49+
50+trickyLet = do
51+ foo
52+ let x = 5
53+ in bar x
data/examples/declaration/value/function/let-multi-line-out.hs+3−3
@@ -2,11 +2,11 @@ foo :: Int -> Int
2foo x =
2foo x =
3 let z = y
3 let z = y
4 y = x
4 y = x
5− in z + 100
5+ in z + 100
6
6
7bar :: Int -> Int
7bar :: Int -> Int
8bar x =
8bar x =
9 let z = y
9 let z = y
10 y = x
10 y = x
11− in z +
11+ in z +
12− 100
12+ 100
src/Ormolu/Printer/Meat/Declaration/Value.hs+1−1
@@ -459,7 +459,7 @@ p_hsExpr = \case
459 HsLet NoExt localBinds e -> do
459 HsLet NoExt localBinds e -> do
460 txt "let "
460 txt "let "
461 sitcc (located localBinds p_hsLocalBinds)
461 sitcc (located localBinds p_hsLocalBinds)
462− breakpoint
462+ vlayout space (newline >> space)
463 txt "in "
463 txt "in "
464 sitcc (located e p_hsExpr)
464 sitcc (located e p_hsExpr)
465 HsDo NoExt ctx es -> do
465 HsDo NoExt ctx es -> do