[improve printing of Grin code some
John Meacham <john@repetae.net>**20070608053806] hunk ./Grin/Grin.hs 286
-    showsPrec _ (Lit i t) | t == tCharzh, Just x <- toIntegral i = tshow (chr x)
hunk ./Grin/Show.hs 140
-prettyVal (ValPrim aprim [] ty) = pprint aprim <> text "::" <> tshow ty
-prettyVal (ValPrim aprim xs ty) = pprint aprim <> tupled (map tshow xs) <> text "::" <> tshow ty
+prettyVal (ValPrim aprim args ty) = f aprim args where
+    f aprim [] = pprint aprim <> text "::" <> tshow ty
+    f (APrim (Op (Op.BinOp bo _ _) _) _) [x,y] | Just (op,prec) <- Op.binopInfix bo = parens (pprintPrec prec x <+> text op <+> pprintPrec prec y)
+    f (APrim (Op (Op.BinOp bo _ _) _) _) [x,y] =  parens $ pprintPrec 1 x <+> char '`' <> tshow bo <> char '`' <+> pprintPrec 1 y
+    f aprim xs = pprint aprim <> tupled (map tshow xs) <> text "::" <> tshow ty