summaryrefslogtreecommitdiff
path: root/src/runtime/haskell/PGF
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2010-02-17 10:31:10 +0000
committerkrasimir <krasimir@chalmers.se>2010-02-17 10:31:10 +0000
commita4d41ef3e32af4f5e2fb2f5e97ff7024aa4dd068 (patch)
tree9a50135aaa799d64772337a68f2b81f9a7db72b3 /src/runtime/haskell/PGF
parentb5d9ae552d64cc887f2d92fc2ba198911eb67735 (diff)
fix in PGF.Printer
Diffstat (limited to 'src/runtime/haskell/PGF')
-rw-r--r--src/runtime/haskell/PGF/Type.hs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/runtime/haskell/PGF/Type.hs b/src/runtime/haskell/PGF/Type.hs
index f43b361ff..70604a123 100644
--- a/src/runtime/haskell/PGF/Type.hs
+++ b/src/runtime/haskell/PGF/Type.hs
@@ -87,11 +87,13 @@ pType = do
ppType :: Int -> [CId] -> Type -> PP.Doc
ppType d scope (DTyp hyps cat args)
- | null hyps = ppParens (d > 3) (ppRes scope cat args)
+ | null hyps = ppRes scope cat args
| otherwise = let (scope',hdocs) = mapAccumL (ppHypo 1) scope hyps
in ppParens (d > 0) (foldr (\hdoc doc -> hdoc PP.<+> PP.text "->" PP.<+> doc) (ppRes scope' cat args) hdocs)
where
- ppRes scope cat es = ppCId cat PP.<+> PP.hsep (map (ppExpr 4 scope) es)
+ ppRes scope cat es
+ | null es = ppCId cat
+ | otherwise = ppParens (d > 3) (ppCId cat PP.<+> PP.hsep (map (ppExpr 4 scope) es))
ppHypo :: Int -> [CId] -> (BindType,CId,Type) -> ([CId],PP.Doc)
ppHypo d scope (Explicit,x,typ) = if x == wildCId