From: Arseniy Alekseyev Date: Wed, 26 Apr 2017 22:14:31 +0000 (+0100) Subject: More parentheses when printing values X-Git-Url: https://git.ak3n.com/?a=commitdiff_plain;h=6ad96ba4d2a2049c993f473f0f5047f248ac701d;p=cubicaltt.git 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. --- 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