@@ -158,18 +158,15 @@ renderDeclaration _ (P.TypeInstanceDeclaration name constraints className tys _)
158 fenced $ "instance " ++ show name ++ " :: " ++ constraintsText ++ show className ++ " " ++ unwords (map P.prettyPrintTypeAtom tys)
158 fenced $ "instance " ++ show name ++ " :: " ++ constraintsText ++ show className ++ " " ++ unwords (map P.prettyPrintTypeAtom tys)
159renderDeclaration exps (P.PositionedDeclaration _ com d) = do
159renderDeclaration exps (P.PositionedDeclaration _ com d) = do
160 renderDeclaration exps d
160 renderDeclaration exps d
162 renderComments com
161 renderComments com
163renderDeclaration _ _ = return ()
162renderDeclaration _ _ = return ()
165renderComments :: [P.Comment] -> Docs
164renderComments :: [P.Comment] -> Docs
166renderComments cs = do
165renderComments cs = do
167 let raw = concatMap toLines cs
166 let raw = concatMap toLines cs
169− if all hasPipe raw
167+ when (all hasPipe raw) $ do
170− then atIndent 0 . unlines . map stripPipes $ raw
169+ atIndent 0 . unlines . map stripPipes $ raw
171− else atIndent 4 $ unlines raw
175 toLines (P.LineComment s) = [s]
172 toLines (P.LineComment s) = [s]