remove square brackets around type lines

(parens are needed if they are anything other than a `term arg`)
This commit is contained in:
rhiannon morris 2023-05-16 18:14:42 +02:00
parent d631b86be3
commit 64de93a13c
7 changed files with 42 additions and 35 deletions

View file

@ -136,9 +136,9 @@ prettyTypeLine : {opts : _} ->
DScopeTerm d n ->
Eff Pretty (Doc opts)
prettyTypeLine dnames tnames (S _ (N body)) =
bracks =<< withPrec Outer (prettyTerm dnames tnames body)
withPrec Arg (prettyTerm dnames tnames body)
prettyTypeLine dnames tnames (S [< i] (Y body)) =
bracks =<< do
parens =<< do
i' <- prettyDBind i
ty' <- withPrec Outer $ prettyTerm (dnames :< i) tnames body
pure $ sep [hsep [i', !darrowD], ty']
@ -281,9 +281,9 @@ prettyTag tag = hl Tag $ text $ "'" ++ quoteTag tag
export
prettyEnum : {opts : _} -> List String -> Eff Pretty (Doc opts)
prettyEnum cases =
tightDelims "{" "}" =<<
tightBraces =<<
fillSeparateTight !commaD <$>
traverse (hl Tag . text . quoteTag) cases
traverse (hl Tag . Doc.text . quoteTag) cases
private
prettyCaseRet : {opts : _} ->