@@ -175,7 +175,8 @@ eval traceon ctxt maxred ntimes genv tm opts = ev ntimes [] True [] tm where
175 ev ntimes (n:stk) True env tm
175 ev ntimes (n:stk) True env tm
176 [(TyDecl nt ty, _)] -> do vty <- ev ntimes stk True env ty
176 [(TyDecl nt ty, _)] -> do vty <- ev ntimes stk True env ty
177 return $ VP nt n vty
177 return $ VP nt n vty
178+ [(CaseOp inl inr _ _ _ [] tree _ _, acc)]
178− [(CaseOp inl inr _ _ _ [] tree _ _, Public)] -> -- unoptimised version
179+ | acc == Public || simpl -> -- unoptimised version
179 if canSimplify inl inr n stk
180 if canSimplify inl inr n stk
180 then liftM (VP Ref n) (ev ntimes stk top env ty)
181 then liftM (VP Ref n) (ev ntimes stk top env ty)
181 else do c <- evCase ntimes (n:stk) top env [] [] tree
182 else do c <- evCase ntimes (n:stk) top env [] [] tree
@@ -244,7 +245,8 @@ eval traceon ctxt maxred ntimes genv tm opts = ev ntimes [] True [] tm where
244 = traceWhen traceon (show stk) $
245 = traceWhen traceon (show stk) $
245 do let val = lookupDefAcc Nothing n atRepl ctxt
246 do let val = lookupDefAcc Nothing n atRepl ctxt
246 case val of
247 case val of
247− [(CaseOp inl inr _ _ _ ns tree _ _, Public)] ->
248+ [(CaseOp inl inr _ _ _ ns tree _ _, acc)]
249+ | acc == Public || simpl -> -- unoptimised version
248 if canSimplify inl inr n stk
250 if canSimplify inl inr n stk
249 then return $ unload env (VP Ref n ty) args
251 then return $ unload env (VP Ref n ty) args
250 else do c <- evCase ntimes (n:stk) top env ns args tree
252 else do c <- evCase ntimes (n:stk) top env ns args tree