@@ -175,7 +175,8 @@ eval traceon ctxt maxred ntimes genv tm opts = ev ntimes [] True [] tm where
175175 ev ntimes (n:stk) True env tm
176176 [(TyDecl nt ty, _)] -> do vty <- ev ntimes stk True env ty
177177 return $ VP nt n vty
178− [(CaseOp inl inr _ _ _ [] tree _ _, Public)] -> -- unoptimised version
178+ [(CaseOp inl inr _ _ _ [] tree _ _, acc)]
179+ | acc == Public || simpl -> -- unoptimised version
179180 if canSimplify inl inr n stk
180181 then liftM (VP Ref n) (ev ntimes stk top env ty)
181182 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
244245 = traceWhen traceon (show stk) $
245246 do let val = lookupDefAcc Nothing n atRepl ctxt
246247 case val of
247− [(CaseOp inl inr _ _ _ ns tree _ _, Public)] ->
248+ [(CaseOp inl inr _ _ _ ns tree _ _, acc)]
249+ | acc == Public || simpl -> -- unoptimised version
248250 if canSimplify inl inr n stk
249251 then return $ unload env (VP Ref n ty) args
250252 else do c <- evCase ntimes (n:stk) top env ns args tree