print dimension app with an @
This commit is contained in:
parent
ab63edf572
commit
eaf679edf7
1 changed files with 8 additions and 5 deletions
|
@ -53,10 +53,13 @@ prettyLams sort names body = do
|
|||
|
||||
export covering
|
||||
prettyApps : PrettyHL f => PrettyHL a => Pretty.HasEnv m =>
|
||||
f -> List a -> m (Doc HL)
|
||||
prettyApps fun args =
|
||||
Maybe (Doc HL) -> f -> List a -> m (Doc HL)
|
||||
prettyApps pfx fun args =
|
||||
parensIfM App =<< withPrec Arg
|
||||
[|prettyM fun <//> (align . sep <$> traverse prettyM args)|]
|
||||
[|prettyM fun <//> (align . sep <$> traverse prettyArg args)|]
|
||||
where
|
||||
prettyArg : a -> m (Doc HL)
|
||||
prettyArg x = maybe id (\p => map (hl Delim p <+>)) pfx $ prettyM x
|
||||
|
||||
export covering
|
||||
prettyTuple : PrettyHL a => Pretty.HasEnv m => List a -> m (Doc HL)
|
||||
|
@ -141,7 +144,7 @@ mutual
|
|||
prettyVar TVar TVarErr (!ask).tnames i
|
||||
prettyM (e :@ s) =
|
||||
let GotArgs {fun, args, _} = getArgs' e [s] in
|
||||
prettyApps fun args
|
||||
prettyApps Nothing fun args
|
||||
prettyM (CasePair pi p (S [r] ret) (S [x, y] body)) = do
|
||||
pat <- (parens . separate commaD . map (hl TVar)) <$>
|
||||
traverse prettyM [x, y]
|
||||
|
@ -151,7 +154,7 @@ mutual
|
|||
[([], prettyTag t, b) | (t, b) <- SortedMap.toList arms]
|
||||
prettyM (e :% d) =
|
||||
let GotDArgs {fun, args, _} = getDArgs' e [d] in
|
||||
prettyApps fun args
|
||||
prettyApps (Just "@") fun args
|
||||
prettyM (s :# a) =
|
||||
parensIfM Ann $ hang 2 $
|
||||
!(withPrec AnnL $ prettyM s) <++> !annD
|
||||
|
|
Loading…
Reference in a new issue