on master help sign in
Make pretty printing for types prettier
commiteaa751d9871c1746ad829f78e768401a6d2071f6 authorEvan Czaplicki <info@elm-lang.org> dateMon 22 Jul 2013, 14:52 (13 years ago) parent138e99c
1 file changed+2−1
compiler/SourceSyntax/Type.hs+2−1
compiler/SourceSyntax/Type.hs+2−1
@@ -38,7 +38,7 @@ instance Pretty Type where
3838 Var x -> P.text x
3939 Data "_List" [t] -> P.brackets (pretty t)
4040 Data name tipes
41− | Help.isTuple name -> P.parens . P.sep . P.punctuate P.comma $ map prettyParens tipes
41+ | Help.isTuple name -> P.parens . P.sep . P.punctuate P.comma $ map pretty tipes
4242 | otherwise -> P.hang (P.text name) 2 (P.sep $ map prettyParens tipes)
4343 EmptyRecord -> P.braces P.empty
4444 Record fields ext -> error "not done yet"
@@ -54,6 +54,7 @@ prettyParens tipe = parensIf needed (pretty tipe)
5454 needed =
5555 case tipe of
5656 Lambda _ _ -> True
57+ Data _ [] -> False
5758 Data _ _ -> True
5859 _ -> False
5960