summaryrefslogtreecommitdiff
path: root/src/GF/GFCC
diff options
context:
space:
mode:
authoraarne <aarne@cs.chalmers.se>2007-10-10 16:13:57 +0000
committeraarne <aarne@cs.chalmers.se>2007-10-10 16:13:57 +0000
commitf479ecac03de40d1cfa6f571b349c481f4c90df1 (patch)
tree01757b95c34021ba0cddec50a5f7cb773ae41762 /src/GF/GFCC
parentf93c17c7b1884fc495092f592e34c706751eb49e (diff)
optimizations on evaluated gf in gfc
Diffstat (limited to 'src/GF/GFCC')
-rw-r--r--src/GF/GFCC/CheckGFCC.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/GF/GFCC/CheckGFCC.hs b/src/GF/GFCC/CheckGFCC.hs
index 12f92bcac..bf9a846e3 100644
--- a/src/GF/GFCC/CheckGFCC.hs
+++ b/src/GF/GFCC/CheckGFCC.hs
@@ -70,11 +70,11 @@ inferTerm args trm = case trm of
testErr (all (==typ) tys) ("different types in table " ++ prt trm)
return (P t' u', typ) -- table: types must be same
_ -> Bad $ "projection from " ++ prt t ++ " : " ++ prt tt
- FV [] -> returnt str ----
+ FV [] -> returnt TM ----
FV (t:ts) -> do
(t',ty) <- infer t
(ts',tys) <- mapM infer ts >>= return . unzip
- testErr (all (==ty) tys) ("different types in variants " ++ prt trm)
+ testErr (all (eqType ty) tys) ("different types in variants " ++ prt trm)
return (FV (t':ts'),ty)
W s r -> infer r
_ -> Bad ("no type inference for " ++ prt trm)
@@ -99,6 +99,7 @@ eqType :: CType -> CType -> Bool
eqType inf exp = case (inf,exp) of
(C k, C n) -> k <= n -- only run-time corr.
(R rs,R ts) -> length rs == length ts && and [eqType r t | (r,t) <- zip rs ts]
+ (TM, _) -> True ---- for variants [] ; not safe
_ -> inf == exp
-- should be in a generic module, but not in the run-time DataGFCC