From cc104236df63dafebaf87612aa379156cf914063 Mon Sep 17 00:00:00 2001 From: aarne Date: Fri, 5 Oct 2007 08:17:27 +0000 Subject: shifted to use general trees and types (with macros for c-f) --- src/GF/GFCC/Macros.hs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/GF/GFCC/Macros.hs') diff --git a/src/GF/GFCC/Macros.hs b/src/GF/GFCC/Macros.hs index cfb257ab8..a23c4c021 100644 --- a/src/GF/GFCC/Macros.hs +++ b/src/GF/GFCC/Macros.hs @@ -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) [] -- cgit v1.2.3