From 9967a612a2b01ce31fb071acec6554036804a2a7 Mon Sep 17 00:00:00 2001 From: Balazs Komuves Date: Sun, 15 Dec 2024 14:54:30 +0100 Subject: [PATCH] fix precedence bug (typo) in pretty-printing --- src/Algebra/Expr.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Algebra/Expr.hs b/src/Algebra/Expr.hs index 5f09e8f..cc4acb0 100644 --- a/src/Algebra/Expr.hs +++ b/src/Algebra/Expr.hs @@ -78,7 +78,7 @@ instance Pretty var => Pretty (Expr var) where LitE x -> prettyPrec 0 x AddE e1 e2 -> showParen (d > add_prec) $ prettyPrec add_prec e1 . showString " + " . prettyPrec (add_prec+1) e2 SubE e1 e2 -> showParen (d > add_prec) $ prettyPrec add_prec e1 . showString " - " . prettyPrec (add_prec+1) e2 - MulE e1 e2 -> showParen (d > mul_prec) $ prettyPrec add_prec e1 . showString " * " . prettyPrec (mul_prec+1) e2 + MulE e1 e2 -> showParen (d > mul_prec) $ prettyPrec mul_prec e1 . showString " * " . prettyPrec (mul_prec+1) e2 ImgE e -> showParen (d > mul_prec) $ showString "X*" . (prettyPrec mul_prec e) where add_prec = 5