Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit b135c62

Browse files
author
Patrick Thomson
committed
Address @robrix's suggestions.
1 parent f0c880c commit b135c62

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

semantic-core/src/Data/Core/Pretty.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ symbol = annotate (Pretty.color Pretty.Yellow)
3939
strlit = annotate (Pretty.colorDull Pretty.Green)
4040
primitive = keyword . mappend "#"
4141

42-
type Prec = Int
42+
type Prec = Int
4343

4444
data Style = Unicode | Ascii
4545

@@ -54,7 +54,7 @@ arrow = ask @Style >>= \case
5454
name :: Name -> AnsiDoc
5555
name = \case
5656
Gen p -> pretty p
57-
Path p -> strlit (Pretty.viaShow p )
57+
Path p -> strlit (Pretty.viaShow p)
5858
User n -> encloseIf (needsQuotation n) (symbol "#{") (symbol "}") (pretty n)
5959

6060
with :: (Member (Reader Prec) sig, Carrier sig m) => Prec -> m a -> m a
@@ -81,12 +81,12 @@ prettify = \case
8181
fore <- with 12 a
8282
aft <- with 12 b
8383

84-
let open = symbol (if 12 > prec then "{" <> softline else "")
85-
close = symbol (if 12 > prec then softline <> "}" else "")
84+
let open = symbol ("{" <> softline)
85+
close = symbol (softline <> "}")
8686
separator = ";" <> Pretty.line
8787
body = fore <> separator <> aft
8888

89-
pure . Pretty.align $ open <> Pretty.align body <> close
89+
pure . Pretty.align $ encloseIf (12 > prec) open close (Pretty.align body)
9090

9191
LamF x f -> inParens 11 $ do
9292
body <- f

0 commit comments

Comments
 (0)