diff options
| author | krasimir <krasimir@chalmers.se> | 2009-09-08 08:40:28 +0000 |
|---|---|---|
| committer | krasimir <krasimir@chalmers.se> | 2009-09-08 08:40:28 +0000 |
| commit | 28a7c4b5c7659dc18166e06e914fb0a81c1c43bc (patch) | |
| tree | 3d4a866f0fe37d8b45230581c44f459d7ac16e3d /src/PGF/Macros.hs | |
| parent | 9940c44259fe3ee4501e324b4d1816a50d77fa37 (diff) | |
now the datatype Tree is only internal. All API functions are working with Expr directly. Commands gt, gr, p and rf filter out the output via the typechecker
Diffstat (limited to 'src/PGF/Macros.hs')
| -rw-r--r-- | src/PGF/Macros.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/PGF/Macros.hs b/src/PGF/Macros.hs index 5d8600090..f6a11799b 100644 --- a/src/PGF/Macros.hs +++ b/src/PGF/Macros.hs @@ -99,10 +99,10 @@ restrictPGF cond pgf = pgf { restrict = Map.filterWithKey (\c _ -> cond c) abstr = abstract pgf -depth :: Tree -> Int -depth (Abs _ t) = depth t -depth (Fun _ ts) = maximum (0:map depth ts) + 1 -depth _ = 1 +depth :: Expr -> Int +depth (EAbs _ t) = depth t +depth (EApp e1 e2) = max (depth e1) (depth e2) + 1 +depth _ = 1 cftype :: [CId] -> CId -> Type cftype args val = DTyp [Hyp (cftype [] arg) | arg <- args] val [] |
