Improve show instance for ABT

- Use precedence in Var case.
This commit is contained in:
Dan Doel 2020-04-17 15:47:40 -04:00
parent abe17a5b20
commit 4c3e52c2be

View File

@ -698,7 +698,7 @@ subtract _ t1s t2s =
instance (Show1 f, Show v) => Show (Term f v a) where
-- annotations not shown
showsPrec p (Term _ _ out) = case out of
Var v -> \x -> "Var " ++ show v ++ x
Var v -> showParen (p>=9) $ \x -> "Var " ++ show v ++ x
Cycle body -> ("Cycle " ++) . showsPrec p body
Abs v body -> showParen True $ (show v ++) . showString ". " . showsPrec p body
Tm f -> showsPrec1 p f