From c1671d43e2aa227fbd12cded2e6209d88181eae9 Mon Sep 17 00:00:00 2001 From: krasimir Date: Mon, 7 Mar 2016 20:20:47 +0000 Subject: current state of the experimental typechecker --- src/compiler/GF/Compile/Compute/ConcreteNew.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/compiler/GF/Compile/Compute') diff --git a/src/compiler/GF/Compile/Compute/ConcreteNew.hs b/src/compiler/GF/Compile/Compute/ConcreteNew.hs index 8ca1568b7..f7551f373 100644 --- a/src/compiler/GF/Compile/Compute/ConcreteNew.hs +++ b/src/compiler/GF/Compile/Compute/ConcreteNew.hs @@ -8,7 +8,7 @@ module GF.Compile.Compute.ConcreteNew import GF.Grammar hiding (Env, VGen, VApp, VRecType) import GF.Grammar.Lookup(lookupResDefLoc,allParamValues) -import GF.Grammar.Predef(cPredef,cErrorType,cTok,cStr,cTrace) +import GF.Grammar.Predef(cPredef,cErrorType,cTok,cStr,cTrace,cPBool) import GF.Grammar.PatternMatch(matchPattern,measurePatt) import GF.Grammar.Lockfield(isLockLabel,lockRecType) --unlockRecord,lockLabel import GF.Compile.Compute.Value hiding (Error) @@ -141,7 +141,9 @@ value env t0 = | m == cPredef -> if f==cErrorType -- to be removed then let p = identS "P" in const # value0 env (mkProd [(Implicit,p,typeType)] (Vr p) []) - else const . flip VApp [] # predef f + else if f==cPBool + then const # resource env x + else const . flip VApp [] # predef f | otherwise -> const # resource env x --valueResDef (fst env) x QC x -> return $ const (VCApp x []) App e1 e2 -> apply' env e1 . (:[]) =<< value env e2 @@ -183,6 +185,7 @@ value env t0 = Glue t1 t2 -> ((ok2p (glue env).) # both id) # both (value env) (t1,t2) ELin c r -> (unlockVRec (gloc env) c.) # value env r EPatt p -> return $ const (VPatt p) -- hmm + Typed t ty -> value env t t -> fail.render $ "value"<+>ppT 10 t $$ show t vconcat vv@(v1,v2) = -- cgit v1.2.3