@@ -32,8 +32,7 @@ import Ormolu.Printer.Meat.Declaration.Signature
32import Ormolu.Printer.Meat.Type
32import Ormolu.Printer.Meat.Type
33import Ormolu.Printer.Operators
33import Ormolu.Printer.Operators
34import Ormolu.Utils
34import Ormolu.Utils
35−import RdrName (RdrName (..))
35+import RdrName (RdrName (..), rdrNameOcc)
36−import RdrName (rdrNameOcc)
37import SrcLoc (combineSrcSpans, isOneLineSpan)
36import SrcLoc (combineSrcSpans, isOneLineSpan)
39-- | Style of a group of equations.
38-- | Style of a group of equations.
@@ -456,7 +455,7 @@ p_hsLocalBinds = \case
456 -- Assigns 'False' to the last element, 'True' to the rest.
455 -- Assigns 'False' to the last element, 'True' to the rest.
457 markInit :: [a] -> [(Bool, a)]
456 markInit :: [a] -> [(Bool, a)]
458 markInit [] = []
457 markInit [] = []
459− markInit (x : []) = [(False, x)]
458+ markInit [x] = [(False, x)]
460 markInit (x : xs) = (True, x) : markInit xs
459 markInit (x : xs) = (True, x) : markInit xs
461 -- NOTE When in a single-line layout, there is a chance that the inner
460 -- NOTE When in a single-line layout, there is a chance that the inner
462 -- elements will also contain semicolons and they will confuse the
461 -- elements will also contain semicolons and they will confuse the
@@ -838,7 +837,7 @@ p_case ::
838 -- | Expression
837 -- | Expression
839 LHsExpr GhcPs ->
838 LHsExpr GhcPs ->
840 -- | Match group
839 -- | Match group
841− (MatchGroup GhcPs (Located body)) ->
840+ MatchGroup GhcPs (Located body) ->
843p_case placer render e mgroup = do
842p_case placer render e mgroup = do
844 txt "case"
843 txt "case"
@@ -1164,7 +1163,7 @@ blockPlacement ::
1164 (body -> Placement) ->
1163 (body -> Placement) ->
1165 [LGRHS GhcPs (Located body)] ->
1164 [LGRHS GhcPs (Located body)] ->
1166 Placement
1165 Placement
1167−blockPlacement placer [(L _ (GRHS NoExt _ (L _ x)))] = placer x
1166+blockPlacement placer [L _ (GRHS NoExt _ (L _ x))] = placer x
1168blockPlacement _ _ = Normal
1167blockPlacement _ _ = Normal
1170-- | Check if given command has a hanging form.
1169-- | Check if given command has a hanging form.
@@ -1257,7 +1256,7 @@ p_exprOpTree isDollarSpecial s (OpBranch x op y) = do
1257 Hanging -> useBraces
1256 Hanging -> useBraces
1258 Normal -> dontUseBraces
1257 Normal -> dontUseBraces
1259 gotDollar = case getOpName (unLoc op) of
1258 gotDollar = case getOpName (unLoc op) of
1260− Just rname -> mkVarOcc "$" == (rdrNameOcc rname)
1259+ Just rname -> mkVarOcc "$" == rdrNameOcc rname
1261 _ -> False
1260 _ -> False
1263 switchLayout [opTreeLoc x] $
1262 switchLayout [opTreeLoc x] $