@@ -1,7 +1,7 @@
11{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances,
22 PatternGuards #-}
33
4−module Core.Evaluate(normalise, specialise, hnf,
4+module Core.Evaluate(normalise, normaliseC, specialise, hnf,
55 Fun(..), Def(..), Context,
66 addToCtxt, addTyDecl, addDatatype, addCasedef, addOperator,
77 lookupTy, lookupP, lookupDef, lookupVal, lookupTyEnv,
@@ -51,6 +51,11 @@ instance Show (a -> b) where
5151-- i.e. it's an intermediate environment that we have while type checking or
5252-- while building a proof.
5353
54+normaliseC :: Context -> Env -> TT Name -> TT Name
55+normaliseC ctxt env t
56+ = evalState (do val <- eval ctxt emptyContext env t []
57+ quote 0 val) ()
58+
5459normalise :: Context -> Env -> TT Name -> TT Name
5560normalise ctxt env t
5661 = evalState (do val <- eval ctxt emptyContext (map finalEntry env) (finalise t) []
@@ -103,7 +108,7 @@ eval ctxt statics genv tm opts = ev True [] tm where
103108 ev top env (V i) | i < length env = return $ env !! i
104109 | otherwise = return $ VV i
105110 ev top env (Bind n (Let t v) sc)
106− = do v' <- ev top env (finalise v)
111+ = do v' <- ev top env v --(finalise v)
107112 sc' <- ev top (v' : env) sc
108113 wknV (-1) sc'
109114 ev top env (Bind n (NLet t v) sc)