summaryrefslogtreecommitdiff
path: root/src/compiler/GF/Haskell.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/GF/Haskell.hs')
-rw-r--r--src/compiler/GF/Haskell.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/compiler/GF/Haskell.hs b/src/compiler/GF/Haskell.hs
index 57601c1d5..8cb8a9177 100644
--- a/src/compiler/GF/Haskell.hs
+++ b/src/compiler/GF/Haskell.hs
@@ -40,6 +40,9 @@ tvar = TId
tcon0 = TId
tcon c = foldl TAp (TId c)
+lets [] e = e
+lets ds e = Lets ds e
+
let1 x xe e = Lets [(x,xe)] e
single x = List [x]
@@ -113,7 +116,8 @@ instance Pretty Exp where
Op e1 op e2 -> hang (ppB e1<+>op) 2 (ppB e2)
Lets bs e -> sep ["let"<+>vcat [hang (x<+>"=") 2 xe|(x,xe)<-bs],
"in" <+>e]
- LambdaCase alts -> hang "\\case" 4 (vcat [p<+>"->"<+>e|(p,e)<-alts])
+ LambdaCase alts ->
+ hang "\\case" 2 (vcat [hang (p<+>"->") 2 e|(p,e)<-alts])
_ -> ppB e
ppB e = case flatAp e of f:as -> hang (ppA f) 2 (sep (map ppA as))