git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #1193 from wuzzeb/master

Small improvements to the pretty printer

commit4dbfe2204d840d230b74f30494b3c476dae4c69c authorPhil Freeman <paf31@cantab.net> dateTue 23 Jun 2015, 15:43 (11 years ago) parent39347bf0cabf01
1 file changed+5−3
src/Language/PureScript/Pretty/Values.hs+5−3
src/Language/PureScript/Pretty/Values.hs+5−3
@@ -71,7 +71,7 @@ literals = mkPattern' match
7171 ]
7272 match (Var ident) = return $ show ident
7373 match (Do els) = concat <$> sequence
74− [ return "do "
74+ [ return "do\n"
7575 , withIndent $ prettyPrintMany prettyPrintDoNotationElement els
7676 , currentIndent
7777 ]
@@ -99,7 +99,10 @@ prettyPrintCaseAlternative (CaseAlternative binders result) =
9999 , prettyPrintResult result
100100 ]
101101 where
102− prettyPrintResult (Left gs) = concat <$> mapM prettyPrintGuardedValue gs
102+ prettyPrintResult (Left gs) = concat <$> sequence
103+ [ return "\n"
104+ , withIndent $ prettyPrintMany prettyPrintGuardedValue gs
105+ ]
103106 prettyPrintResult (Right v) = (" -> " ++) <$> prettyPrintValue' v
104107
105108 prettyPrintGuardedValue (grd, val) =
@@ -108,7 +111,6 @@ prettyPrintCaseAlternative (CaseAlternative binders result) =
108111 , prettyPrintValue' grd
109112 , return " -> "
110113 , prettyPrintValue' val
111− , return "\n"
112114 ]
113115
114116prettyPrintDoNotationElement :: DoNotationElement -> StateT PrinterState Maybe String