on master help sign in
Make record constructors hang
commit695842ec26d50b31fd421cc2ab6ca95aced40605 authormrkkrp <mark.karpov@tweag.io> dateWed 12 Jun 2019, 21:37 (7 years ago) parent0d4da7f
3 files changed+12−13
data/examples/declaration/value/function/record-constructors-out.hs+4−5 data/examples/declaration/value/function/record-wildcards-out.hs+6−7 src/Ormolu/Printer/Meat/Declaration/Value.hs+2−1
data/examples/declaration/value/function/record-constructors-out.hs+4−5
@@ -1,9 +1,8 @@
11foo = Foo {a = 3}
22
3−bar =
4− Bar
5− { abc = foo
6− , def = Foo {a = 10}
7− }
3+bar = Bar
4+ { abc = foo
5+ , def = Foo {a = 10}
6+ }
87
98baz = Baz {}
data/examples/declaration/value/function/record-wildcards-out.hs+6−7
@@ -2,12 +2,11 @@
22{-# LANGUAGE RecordWildCards #-}
33foo x y = Foo {x, y}
44
5−bar x y z =
6− Bar
7− { x
8− , y
9− , z
10− , ..
11− }
5+bar x y z = Bar
6+ { x
7+ , y
8+ , z
9+ , ..
10+ }
1211
1312baz = Baz {..}
src/Ormolu/Printer/Meat/Declaration/Value.hs+2−1
@@ -573,9 +573,10 @@ blockPlacement _ = Normal
573573exprPlacement :: HsExpr GhcPs -> Placement
574574exprPlacement = \case
575575 HsLam NoExt _ -> Hanging
576+ HsLamCase NoExt _ -> Hanging
576577 HsCase NoExt _ _ -> Hanging
577578 HsDo NoExt _ _ -> Hanging
578− HsLamCase NoExt _ -> Hanging
579+ RecordCon NoExt _ _ -> Hanging
579580 _ -> Normal
580581
581582withGuards :: [LGRHS GhcPs (LHsExpr GhcPs)] -> Bool