on master help sign in
Don't use braces inside parens
1d3eebaUtku Demir
data/examples/declaration/value/function/parens-out.hsnew file+1
@@ -0,0 +1 @@
1+f = p (do foo; bar) baz
data/examples/declaration/value/function/parens.hsnew file+1
@@ -0,0 +1 @@
1+f = p (do foo; bar) baz
src/Ormolu/Printer/Meat/Declaration/Type.hs+1−1
@@ -30,7 +30,7 @@ p_synDecl name fixity tvars t = do
30 let HsQTvs {..} = tvars
30 let HsQTvs {..} = tvars
31 switchLayout (getLoc name : map getLoc hsq_explicit) $ do
31 switchLayout (getLoc name : map getLoc hsq_explicit) $ do
32 p_infixDefHelper
32 p_infixDefHelper
33− (case fixity of { Infix -> True; _ -> False })
33+ (case fixity of Infix -> True; _ -> False)
34 inci
34 inci
35 (p_rdrName name)
35 (p_rdrName name)
36 (map (located' p_hsTyVarBndr) hsq_explicit)
36 (map (located' p_hsTyVarBndr) hsq_explicit)
src/Ormolu/Printer/Meat/Declaration/Value.hs+2−1
@@ -557,7 +557,8 @@ p_hsExpr' s = \case
557 txt "-"
557 txt "-"
558 space
558 space
559 located e p_hsExpr
559 located e p_hsExpr
560+ HsPar NoExt e ->
560− HsPar NoExt e -> parens s (located e p_hsExpr)
561+ parens s (located e (dontUseBraces . p_hsExpr))
561 SectionL NoExt x op -> do
562 SectionL NoExt x op -> do
562 located x p_hsExpr
563 located x p_hsExpr
563 breakpoint
564 breakpoint