aboutsummaryrefslogtreecommitdiff
path: root/kernel/cooking.ml
diff options
context:
space:
mode:
authorMaxime Dénès2017-04-07 01:34:51 +0200
committerMaxime Dénès2017-04-07 01:34:51 +0200
commitb34645a227dfebc2212c4fcc05c830a2b40708ea (patch)
tree7a191a5c24f5565c5c821468cacb5af48de64896 /kernel/cooking.ml
parentf81d1b2a0b22f45c82f061ba408468c28b47535c (diff)
parentd939a024cd077c8abce709dd69eb805cab9068db (diff)
Merge PR#519: Faster side effects
Diffstat (limited to 'kernel/cooking.ml')
-rw-r--r--kernel/cooking.ml8
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/cooking.ml b/kernel/cooking.ml
index f5059cd750..a9f212393e 100644
--- a/kernel/cooking.ml
+++ b/kernel/cooking.ml
@@ -191,15 +191,19 @@ let lift_univs cb subst =
subst, Univ.UContext.make (inst,cstrs')
else subst, cb.const_universes
-let cook_constant env { from = cb; info } =
+let cook_constant ~hcons env { from = cb; info } =
let { Opaqueproof.modlist; abstract } = info in
let cache = RefTable.create 13 in
let abstract, usubst, abs_ctx = abstract in
let usubst, univs = lift_univs cb usubst in
let expmod = expmod_constr_subst cache modlist usubst in
let hyps = Context.Named.map expmod abstract in
+ let map c =
+ let c = abstract_constant_body (expmod c) hyps in
+ if hcons then hcons_constr c else c
+ in
let body = on_body modlist (hyps, usubst, abs_ctx)
- (fun c -> abstract_constant_body (expmod c) hyps)
+ map
cb.const_body
in
let const_hyps =