change printing of binders
old: (1 | 1 | x : A) -> new: (x @ 1, 1 : A) ->
This commit is contained in:
parent
d5530f9884
commit
40fde92823
2 changed files with 10 additions and 4 deletions
|
@ -27,11 +27,16 @@ PrettyHL Qty where
|
||||||
One => ifUnicode "𝟭" "1"
|
One => ifUnicode "𝟭" "1"
|
||||||
Any => ifUnicode "𝛚" "*"
|
Any => ifUnicode "𝛚" "*"
|
||||||
|
|
||||||
|
private
|
||||||
|
commas : List (Doc HL) -> List (Doc HL)
|
||||||
|
commas [] = []
|
||||||
|
commas [x] = [x]
|
||||||
|
commas (x::xs) = (x <+> hl Delim ",") :: commas xs
|
||||||
|
|
||||||
export %inline
|
export %inline
|
||||||
prettyQtyBinds : Pretty.HasEnv m => List Qty -> m (Doc HL)
|
prettyQtyBinds : Pretty.HasEnv m => List Qty -> m (Doc HL)
|
||||||
prettyQtyBinds =
|
prettyQtyBinds =
|
||||||
map (align . sep) .
|
map ((hl Delim "@" <++>) . align . sep . commas) . traverse pretty0M
|
||||||
traverse (\pi => [|pretty0M pi <++> pure (hl Delim "|")|])
|
|
||||||
|
|
||||||
|
|
||||||
public export
|
public export
|
||||||
|
|
|
@ -172,8 +172,9 @@ mutual
|
||||||
prettyBinder : Pretty.HasEnv m => List Qty -> Name -> Term d n -> m (Doc HL)
|
prettyBinder : Pretty.HasEnv m => List Qty -> Name -> Term d n -> m (Doc HL)
|
||||||
prettyBinder pis x a =
|
prettyBinder pis x a =
|
||||||
pure $ parens $ hang 2 $
|
pure $ parens $ hang 2 $
|
||||||
!(prettyQtyBinds pis) <//>
|
hsep [hl TVar !(prettyM x),
|
||||||
hsep [hl TVar !(prettyM x), colonD, !(withPrec Outer $ prettyM a)]
|
sep [!(prettyQtyBinds pis),
|
||||||
|
hsep [colonD, !(withPrec Outer $ prettyM a)]]]
|
||||||
|
|
||||||
|
|
||||||
export FromVar (Elim d) where fromVar = B
|
export FromVar (Elim d) where fromVar = B
|
||||||
|
|
Loading…
Reference in a new issue