From 28a7c4b5c7659dc18166e06e914fb0a81c1c43bc Mon Sep 17 00:00:00 2001 From: krasimir Date: Tue, 8 Sep 2009 08:40:28 +0000 Subject: 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 --- src/PGF/Macros.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/PGF/Macros.hs') 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 [] -- cgit v1.2.3