on master help sign in
Prettier printing
commit128e21db217415b077baa64e8964ce038ed70969 authorEvan Czaplicki <info@elm-lang.org> dateSun 1 Sep 2013, 22:51 (13 years ago) parente8dffac
1 file changed+2
compiler/SourceSyntax/Expression.hs+2
compiler/SourceSyntax/Expression.hs+2
@@ -55,6 +55,8 @@ instance Pretty (Expr t v) where
5555 Var x -> variable x
5656 Range e1 e2 -> P.brackets (pretty e1 <> P.text ".." <> pretty e2)
5757 ExplicitList es -> P.brackets (commaCat (map pretty es))
58+ Binop "-" (Location.L _ (Literal (Literal.IntNum 0))) e ->
59+ P.text "-" <> prettyParens e
5860 Binop op e1 e2 -> P.sep [ prettyParens e1 <+> P.text op', prettyParens e2 ]
5961 where op' = if Help.isOp op then op else "`" ++ op ++ "`"
6062 Lambda p e -> let (ps,body) = collectLambdas (Location.none $ Lambda p e)