shifted to use general trees and types (with macros for c-f)

This commit is contained in:
aarne
2007-10-05 08:17:27 +00:00
parent 07d2910df1
commit cc104236df
5 changed files with 38 additions and 24 deletions

View File

@@ -38,6 +38,20 @@ depth tr = case tr of
tree :: Atom -> [Exp] -> Exp
tree = DTr []
cftype :: [CId] -> CId -> Type
cftype args val = DTyp [Hyp wildCId (cftype [] arg) | arg <- args] val []
catSkeleton :: Type -> ([CId],CId)
catSkeleton ty = case ty of
DTyp hyps val _ -> ([valCat ty | Hyp _ ty <- hyps],val)
valCat :: Type -> CId
valCat ty = case ty of
DTyp _ val _ -> val
wildCId :: CId
wildCId = CId "_"
exp0 :: Exp
exp0 = Tr (AM 0) []