diff options
| author | Thomas Hallgren <th-github@altocumulus.org> | 2019-01-23 02:47:10 +0100 |
|---|---|---|
| committer | Thomas Hallgren <th-github@altocumulus.org> | 2019-01-23 02:47:10 +0100 |
| commit | 951b8841187ed2ba4c2815a074e68697544f31a5 (patch) | |
| tree | 50633e6d928789c240454eb65eaedc6b2ad59f59 /src/compiler/GF/Haskell.hs | |
| parent | fc5c2b5a22f66912c1e5dab97a35c2f229093255 (diff) | |
Export of concrete syntax to Haskell now goes via Canonical GF
TODO: better treatment of Predef functions and record subtyping coercions
Diffstat (limited to 'src/compiler/GF/Haskell.hs')
| -rw-r--r-- | src/compiler/GF/Haskell.hs | 6 |
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)) |
