aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/extraction/mlutil.ml
diff options
context:
space:
mode:
authorGravatar Maxime Dénès <mail@maximedenes.fr>2017-10-06 12:46:26 +0200
committerGravatar Maxime Dénès <mail@maximedenes.fr>2017-10-06 12:46:26 +0200
commit6cb1829829de5edfe733b901c38a8b39ba03ef56 (patch)
tree2a9693af05a55faa3a2275936db445478732bce6 /plugins/extraction/mlutil.ml
parent3de25a6f91ec3cc5c9173ab7c93caee87cae578f (diff)
parentd459c4b237e764740fdcfba71ac92a79e426f1de (diff)
Merge PR #1118: Extraction : minor support stuff for the new Extraction Compute plugin
Diffstat (limited to 'plugins/extraction/mlutil.ml')
-rw-r--r--plugins/extraction/mlutil.ml10
1 files changed, 7 insertions, 3 deletions
diff --git a/plugins/extraction/mlutil.ml b/plugins/extraction/mlutil.ml
index b16b430a8..b01b0198d 100644
--- a/plugins/extraction/mlutil.ml
+++ b/plugins/extraction/mlutil.ml
@@ -127,11 +127,15 @@ let rec mgu = function
| Taxiom, Taxiom -> ()
| _ -> raise Impossible
-let needs_magic p = try mgu p; false with Impossible -> true
+let skip_typing () = lang () == Scheme || is_extrcompute ()
-let put_magic_if b a = if b && lang () != Scheme then MLmagic a else a
+let needs_magic p =
+ if skip_typing () then false
+ else try mgu p; false with Impossible -> true
-let put_magic p a = if needs_magic p && lang () != Scheme then MLmagic a else a
+let put_magic_if b a = if b then MLmagic a else a
+
+let put_magic p a = if needs_magic p then MLmagic a else a
let generalizable a =
lang () != Ocaml ||