diff --git a/src/Text/Pretty/Simple/Internal/Printer.hs b/src/Text/Pretty/Simple/Internal/Printer.hs index 14c64ae..8ae1bd6 100644 --- a/src/Text/Pretty/Simple/Internal/Printer.hs +++ b/src/Text/Pretty/Simple/Internal/Printer.hs @@ -255,7 +255,10 @@ prettyExpr opts = (if outputOptionsCompact opts then group else id) . \case spaceIfNeeded = \case Other (' ' : _) : _ -> mempty _ -> space - lineAndCommaSep x y = x <> line' <> annotate Comma "," <> y + lineAndCommaSep x y = + if outputOptionsCompact + then x <> annotate Comma "," <> y + else x <> line' <> annotate Comma "," <> y -- | Determine whether this expression should be displayed on a single line. isSimple :: Expr -> Bool