Don't use braces inside parens
commit1d3eeba70100d8c82c315eb520e9ee1dd5de0dd6
authorUtku Demir <me@utdemir.com>
dateTue 8 Oct 2019, 12:49 (7 years ago)
parentd02483a
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
3030 let HsQTvs {..} = tvars
3131 switchLayout (getLoc name : map getLoc hsq_explicit) $ do
3232 p_infixDefHelper
33− (case fixity of { Infix -> True; _ -> False })
33+ (case fixity of Infix -> True; _ -> False)
3434 inci
3535 (p_rdrName name)
3636 (map (located' p_hsTyVarBndr) hsq_explicit)
src/Ormolu/Printer/Meat/Declaration/Value.hs+2−1
@@ -557,7 +557,8 @@ p_hsExpr' s = \case
557557 txt "-"
558558 space
559559 located e p_hsExpr
560− HsPar NoExt e -> parens s (located e p_hsExpr)
560+ HsPar NoExt e ->
561+ parens s (located e (dontUseBraces . p_hsExpr))
561562 SectionL NoExt x op -> do
562563 located x p_hsExpr
563564 breakpoint