on master help sign in
Make pretty printing code nicer
commitc61d87f010f045343b248159ef995a022a2c4eab authorEvan Czaplicki <info@elm-lang.org> dateMon 17 Aug 2015, 16:36 (11 years ago) parent62e1886
1 file changed+10−5
src/AST/Literal.hs+10−5
src/AST/Literal.hs+10−5
@@ -18,12 +18,17 @@ data Literal
1818
1919instance P.Pretty Literal where
2020 pretty _ _ literal =
21+ P.text (toString literal)
22+
23+
24+toString :: Literal -> String
25+toString literal =
2126 case literal of
22− IntNum n -> P.int n
23− FloatNum n -> P.double n
24− Chr c -> P.text . show $ c
25− Str s -> P.text . show $ s
26− Boolean bool -> P.text (show bool)
27+ IntNum n -> show n
28+ FloatNum n -> show n
29+ Chr c -> show c
30+ Str s -> show s
31+ Boolean bool -> show bool
2732
2833
2934data GLTipe