diff --git a/data/examples/declaration/value/function/do.hs b/data/examples/declaration/value/function/do.hs index cadd360..196e6e7 100644 --- a/data/examples/declaration/value/function/do.hs +++ b/data/examples/declaration/value/function/do.hs @@ -40,7 +40,7 @@ foo = do c <- a + b print c - rec something $ do + rec something $ do x <- a print x diff --git a/src/Ormolu/Printer/Combinators.hs b/src/Ormolu/Printer/Combinators.hs index 8090950..aeab922 100644 --- a/src/Ormolu/Printer/Combinators.hs +++ b/src/Ormolu/Printer/Combinators.hs @@ -181,7 +181,7 @@ backticks m = do -- | Surround given entity by banana brackets (i.e., from arrow notation.) banana :: R () -> R () -banana m = sitcc $ do +banana m = sitcc $ do txt "(|" ospaces m txt "|)" diff --git a/src/Ormolu/Printer/Meat/Declaration/Class.hs b/src/Ormolu/Printer/Meat/Declaration/Class.hs index ee47617..0f54618 100644 --- a/src/Ormolu/Printer/Meat/Declaration/Class.hs +++ b/src/Ormolu/Printer/Meat/Declaration/Class.hs @@ -41,9 +41,9 @@ p_classDecl ctx name tvars fixity fdeps csigs cdefs cats catdefs = do dependencySpans = getLoc <$> fdeps combinedSpans = getLoc ctx : (signatureSpans ++ dependencySpans) txt "class" - switchLayout combinedSpans $ do + switchLayout combinedSpans $ do breakpoint - inci $ do + inci $ do p_classContext ctx switchLayout signatureSpans $ do p_infixDefHelper @@ -73,7 +73,7 @@ p_classDecl ctx name tvars fixity fdeps csigs cdefs cats catdefs = do else newline p_classContext :: LHsContext GhcPs -> R () -p_classContext ctx = unless (null (unLoc ctx)) $ do +p_classContext ctx = unless (null (unLoc ctx)) $ do located ctx p_hsContext breakpoint txt "=> " diff --git a/src/Ormolu/Printer/Meat/Declaration/Data.hs b/src/Ormolu/Printer/Meat/Declaration/Data.hs index 8ba48e4..56a4ba9 100644 --- a/src/Ormolu/Printer/Meat/Declaration/Data.hs +++ b/src/Ormolu/Printer/Meat/Declaration/Data.hs @@ -30,12 +30,12 @@ p_dataDecl style name tpats fixity HsDataDefn {..} = do txt $ case dd_ND of NewType -> "newtype" DataType -> "data" - txt $ case style of + txt $ case style of Associated -> mempty Free -> " instance" switchLayout (getLoc name : fmap getLoc tpats) $ do breakpoint - inci $ p_infixDefHelper + inci $ p_infixDefHelper (isInfix fixity) inci (p_rdrName name) diff --git a/src/Ormolu/Printer/Meat/Declaration/Instance.hs b/src/Ormolu/Printer/Meat/Declaration/Instance.hs index 83c945e..0c059d7 100644 --- a/src/Ormolu/Printer/Meat/Declaration/Instance.hs +++ b/src/Ormolu/Printer/Meat/Declaration/Instance.hs @@ -69,7 +69,7 @@ p_clsInstDecl = \case case cid_poly_ty of HsIB {..} -> located hsib_body $ \x -> do breakpoint - inci $ do + inci $ do match_overlap_mode cid_overlap_mode breakpoint p_hsType x -- GHC's AST does not necessarily store each kind of element in source diff --git a/src/Ormolu/Printer/Meat/Declaration/TypeFamily.hs b/src/Ormolu/Printer/Meat/Declaration/TypeFamily.hs index 2e9206c..13b5e88 100644 --- a/src/Ormolu/Printer/Meat/Declaration/TypeFamily.hs +++ b/src/Ormolu/Printer/Meat/Declaration/TypeFamily.hs @@ -26,7 +26,7 @@ p_famDecl style FamilyDecl {..} = do DataFamily -> Nothing <$ txt "data" OpenTypeFamily -> Nothing <$ txt "type" ClosedTypeFamily eqs -> Just eqs <$ txt "type" - txt $ case style of + txt $ case style of Associated -> mempty Free -> " family" let HsQTvs {..} = fdTyVars diff --git a/src/Ormolu/Printer/Meat/Declaration/Value.hs b/src/Ormolu/Printer/Meat/Declaration/Value.hs index 632bfe0..ff41a8b 100644 --- a/src/Ormolu/Printer/Meat/Declaration/Value.hs +++ b/src/Ormolu/Printer/Meat/Declaration/Value.hs @@ -235,7 +235,7 @@ p_grhs' pretty style (GRHS NoExt guards body) = txt "| " sitcc (sep (comma >> breakpoint) (sitcc . located' p_stmt) xs) space - txt $ case style of + txt $ case style of EqualSign -> "=" RightArrow -> "->" breakpoint @@ -248,14 +248,14 @@ p_hsCmd :: HsCmd GhcPs -> R () p_hsCmd = \case HsCmdArrApp NoExt body input arrType _ -> do located body p_hsExpr - txt $ case arrType of + txt $ case arrType of HsFirstOrderApp -> " -<" HsHigherOrderApp -> " -<<" placeHanging (exprPlacement (unLoc input)) $ located input p_hsExpr - HsCmdArrForm NoExt form Prefix _ cmds -> banana $ sitcc $ do + HsCmdArrForm NoExt form Prefix _ cmds -> banana $ sitcc $ do located form p_hsExpr - unless (null cmds) $ do + unless (null cmds) $ do breakpoint inci (sequence_ (intersperse breakpoint (located' p_hsCmdTop <$> cmds))) HsCmdArrForm NoExt form Infix _ [left, right] -> do @@ -406,7 +406,7 @@ p_hsRecField -> R () p_hsRecField = \HsRecField {..} -> do located hsRecFieldLbl atom - unless hsRecPun $ do + unless hsRecPun $ do txt " = " located hsRecFieldArg p_hsExpr @@ -607,7 +607,7 @@ p_hsExpr = \case HsSpliceE NoExt splice -> p_hsSplice splice HsProc NoExt p e -> do txt "proc" - located p $ \x -> do + located p $ \x -> do breakpoint inci (p_pat x) breakpoint diff --git a/src/Ormolu/Printer/Meat/Type.hs b/src/Ormolu/Printer/Meat/Type.hs index 67965df..1e3a7b7 100644 --- a/src/Ormolu/Printer/Meat/Type.hs +++ b/src/Ormolu/Printer/Meat/Type.hs @@ -165,7 +165,7 @@ p_conDeclField (XConDeclField NoExt) = notImplemented "XConDeclField" tyVarsToTypes :: LHsQTyVars GhcPs -> [LHsType GhcPs] tyVarsToTypes = \case - HsQTvs {..} -> fmap tyVarToType <$> hsq_explicit + HsQTvs {..} -> fmap tyVarToType <$> hsq_explicit XLHsQTyVars {} -> notImplemented "XLHsQTyVars" tyVarToType :: HsTyVarBndr GhcPs -> HsType GhcPs