summaryrefslogtreecommitdiff
path: root/src/GF/Canon
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2007-01-05 17:34:44 +0000
committerbringert <bringert@cs.chalmers.se>2007-01-05 17:34:44 +0000
commitefb806f22608d9e82ad80e733c20449c80f4c0a6 (patch)
tree18d6011611d444db0cc09bb28e5ac152fc8bf47f /src/GF/Canon
parent36a1998ba3f4978c6a9cf9c82e539f395c8566eb (diff)
SISR code now type annotates meta variables directly in grammar, to avoid a separate type annotation step.
Diffstat (limited to 'src/GF/Canon')
-rw-r--r--src/GF/Canon/GFCC/DataGFCC.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/GF/Canon/GFCC/DataGFCC.hs b/src/GF/Canon/GFCC/DataGFCC.hs
index 389afc5a7..43ce04166 100644
--- a/src/GF/Canon/GFCC/DataGFCC.hs
+++ b/src/GF/Canon/GFCC/DataGFCC.hs
@@ -35,6 +35,10 @@ lookLin :: GFCC -> CId -> CId -> Term
lookLin mcfg lang fun =
lookMap TM fun $ lookMap undefined lang $ concretes mcfg
+-- | Look up the type of a function.
+lookType :: GFCC -> CId -> Type
+lookType gfcc f = lookMap (error $ "lookType " ++ show f) f (funs (abstract gfcc))
+
linearize :: GFCC -> CId -> Exp -> String
linearize mcfg lang = realize . linExp mcfg lang