diff options
| author | aarne <aarne@cs.chalmers.se> | 2007-10-10 16:13:57 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2007-10-10 16:13:57 +0000 |
| commit | f479ecac03de40d1cfa6f571b349c481f4c90df1 (patch) | |
| tree | 01757b95c34021ba0cddec50a5f7cb773ae41762 /src/GF/GFCC/CheckGFCC.hs | |
| parent | f93c17c7b1884fc495092f592e34c706751eb49e (diff) | |
optimizations on evaluated gf in gfc
Diffstat (limited to 'src/GF/GFCC/CheckGFCC.hs')
| -rw-r--r-- | src/GF/GFCC/CheckGFCC.hs | 5 |
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 |
