on master help sign in
Make record constructors hang
695842emrkkrp
data/examples/declaration/value/function/record-constructors-out.hs+4−5
@@ -1,9 +1,8 @@
1foo = Foo {a = 3}
1foo = Foo {a = 3}
2
2
3−bar =
3+bar = Bar
4− Bar
5− { abc = foo
4+ { abc = foo
6− , def = Foo {a = 10}
5+ , def = Foo {a = 10}
7− }
6+ }
8
7
9baz = Baz {}
8baz = Baz {}
data/examples/declaration/value/function/record-wildcards-out.hs+6−7
@@ -2,12 +2,11 @@
2{-# LANGUAGE RecordWildCards #-}
2{-# LANGUAGE RecordWildCards #-}
3foo x y = Foo {x, y}
3foo x y = Foo {x, y}
4
4
5−bar x y z =
5+bar x y z = Bar
6− Bar
7− { x
6+ { x
8− , y
7+ , y
9− , z
8+ , z
10− , ..
9+ , ..
11− }
10+ }
12
11
13baz = Baz {..}
12baz = Baz {..}
src/Ormolu/Printer/Meat/Declaration/Value.hs+2−1
@@ -573,9 +573,10 @@ blockPlacement _ = Normal
573exprPlacement :: HsExpr GhcPs -> Placement
573exprPlacement :: HsExpr GhcPs -> Placement
574exprPlacement = \case
574exprPlacement = \case
575 HsLam NoExt _ -> Hanging
575 HsLam NoExt _ -> Hanging
576+ HsLamCase NoExt _ -> Hanging
576 HsCase NoExt _ _ -> Hanging
577 HsCase NoExt _ _ -> Hanging
577 HsDo NoExt _ _ -> Hanging
578 HsDo NoExt _ _ -> Hanging
578− HsLamCase NoExt _ -> Hanging
579+ RecordCon NoExt _ _ -> Hanging
579 _ -> Normal
580 _ -> Normal
580
581
581withGuards :: [LGRHS GhcPs (LHsExpr GhcPs)] -> Bool
582withGuards :: [LGRHS GhcPs (LHsExpr GhcPs)] -> Bool