on master help sign in
reprime when printing types
commit7c19935d863359fc62a6f59b8ee9dcee2177b4dc authorEvan Czaplicki <info@elm-lang.org> dateWed 14 Aug 2013, 00:44 (13 years ago) parent0e62924
2 files changed+6−3
compiler/Type/PrettyPrint.hs+4−1 compiler/Type/Type.hs+2−2
compiler/Type/PrettyPrint.hs+4−1
@@ -2,6 +2,7 @@
22module Type.PrettyPrint where
33
44import Text.PrettyPrint
5+import qualified SourceSyntax.PrettyPrint as Src
56
67data ParensWhen = Fn | App | Never
78
@@ -10,4 +11,6 @@ class PrettyType a where
1011
1112commaSep docs = sep (punctuate comma docs)
1213
13−parensIf bool doc = if bool then parens doc else doc
14+parensIf bool doc = if bool then parens doc else doc
15+
16+reprime = Src.reprime
compiler/Type/Type.hs+2−2
@@ -176,7 +176,7 @@ instance PrettyType a => PrettyType (Term1 a) where
176176 prettyExt = prty ext
177177 extend | P.render prettyExt == "{}" = P.empty
178178 | otherwise = prettyExt <+> P.text "|"
179− mkPretty f t = P.text f <+> P.text ":" <+> prty t
179+ mkPretty f t = P.text (reprime f) <+> P.text ":" <+> prty t
180180 prettyFields = concatMap (\(f,ts) -> map (mkPretty f) ts) (Map.toList fields)
181181
182182
@@ -191,7 +191,7 @@ instance PrettyType Descriptor where
191191 pretty when desc =
192192 case (structure desc, name desc) of
193193 (Just term, _) -> pretty when term
194− (_, Just name) -> if not (isTuple name) then P.text name else
194+ (_, Just name) -> if not (isTuple name) then P.text (reprime name) else
195195 P.parens . P.text $ replicate (read (drop 6 name) - 1) ','
196196 _ -> P.text "?"
197197