From 951b8841187ed2ba4c2815a074e68697544f31a5 Mon Sep 17 00:00:00 2001 From: Thomas Hallgren Date: Wed, 23 Jan 2019 02:47:10 +0100 Subject: Export of concrete syntax to Haskell now goes via Canonical GF TODO: better treatment of Predef functions and record subtyping coercions --- src/compiler/GF/Haskell.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/compiler/GF/Haskell.hs') 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)) -- cgit v1.2.3