1
1
mirror of https://github.com/google/ormolu.git synced 2024-12-02 23:43:34 +03:00

Shift ‘in’ in ‘let’ to the right to allow placing it in do blocks

It is a bit uncommon to format it like this, but this way it can be placed
without changes in do blocks as well. I think it's the right way go about
that bug.
This commit is contained in:
mrkkrp 2019-07-07 14:08:41 +02:00 committed by Mark Karpov
parent 01486edadb
commit 3d74f2fb53
4 changed files with 14 additions and 4 deletions

View File

@ -47,3 +47,8 @@ foo = do
print x
y <- c
print y
trickyLet = do
foo
let x = 5
in bar x

View File

@ -46,3 +46,8 @@ foo = do
y <- c
print y
trickyLet = do
foo
let x = 5
in bar x

View File

@ -2,11 +2,11 @@ foo :: Int -> Int
foo x =
let z = y
y = x
in z + 100
in z + 100
bar :: Int -> Int
bar x =
let z = y
y = x
in z +
100
in z +
100

View File

@ -459,7 +459,7 @@ p_hsExpr = \case
HsLet NoExt localBinds e -> do
txt "let "
sitcc (located localBinds p_hsLocalBinds)
breakpoint
vlayout space (newline >> space)
txt "in "
sitcc (located e p_hsExpr)
HsDo NoExt ctx es -> do