From 6ad96ba4d2a2049c993f473f0f5047f248ac701d Mon Sep 17 00:00:00 2001 From: Arseniy Alekseyev Date: Wed, 26 Apr 2017 23:14:31 +0100 Subject: [PATCH] More parentheses when printing values Fixes a bug where not enough parentheses would be printed. Previously if a function F is defined by split, `F (F x)` would be printed as `F F x`. Now it's printed as `F (F x)` as it should. --- CTT.hs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/CTT.hs b/CTT.hs index 0c14a12..9b06864 100644 --- a/CTT.hs +++ b/CTT.hs @@ -484,10 +484,7 @@ showVal1 v = case v of VVar{} -> showVal v VFst{} -> showVal v VSnd{} -> showVal v - Ter t@Sum{} rho -> showTer t <+> showEnv False rho - Ter t@HSum{} rho -> showTer t <+> showEnv False rho - Ter t@Split{} rho -> showTer t <+> showEnv False rho - Ter t rho -> showTer1 t <+> showEnv True rho + Ter t rho | showEnv False rho == PP.empty -> showTer1 t _ -> parens (showVal v) showVals :: [Val] -> Doc -- 2.34.1