summaryrefslogtreecommitdiff
path: root/src/GF/GFCC/Macros.hs
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2007-10-05 08:17:27 +0000
committeraarne <aarne@cs.chalmers.se>2007-10-05 08:17:27 +0000
commitcc104236df63dafebaf87612aa379156cf914063 (patch)
tree2cad2a5e4cd021204bab62fdd0fe555e2f4e6d0d /src/GF/GFCC/Macros.hs
parent07d2910df14842b1882512af0cb3717be6c303bc (diff)
shifted to use general trees and types (with macros for c-f)
Diffstat (limited to 'src/GF/GFCC/Macros.hs')
-rw-r--r--src/GF/GFCC/Macros.hs14
1 files changed, 14 insertions, 0 deletions
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) []