@@ -9,6 +9,7 @@ import System.IO.Unsafe
99import Control.Applicative ((<$>),(<*>))
1010import Control.Monad.State
1111import Data.Traversable (traverse)
12+import SourceSyntax.Helpers (isTuple)
1213
1314data Term1 a
1415 = App1 a a
@@ -143,9 +144,10 @@ instance PrettyType a => PrettyType (Term1 a) where
143144 pretty when term =
144145 let prty = pretty Never in
145146 case term of
146− App1 f x ->
147− parensIf needed (prty f <+> pretty App x)
147+ App1 f x | P.render px == "_List" -> P.brackets (pretty Never x)
148+ | otherwise -> parensIf needed (px <+> pretty App x)
148149 where
150+ px = prty f
149151 needed = case when of
150152 App -> True
151153 _ -> False
@@ -179,7 +181,8 @@ instance PrettyType Descriptor where
179181 pretty when desc =
180182 case (structure desc, name desc) of
181183 (Just term, _) -> pretty when term
182− (_, Just name) -> P.text name
184+ (_, Just name) -> if not (isTuple name) then P.text name else
185+ P.parens . P.text $ replicate (read (drop 6 name) - 1) ','
183186 _ -> P.text "?"
184187
185188