Commits

camlspotter  committed 8b9a20e

cleanup

  • Participants
  • Parent commits 2afc1eb

Comments (0)

Files changed (1)

File examples/double_phantom.ml

 end)
 open Monad.Open
  
-let double = build (func "double" i32 (P.c1 (P.combine "param" i32)) ~dump:true (fun 
-  _self (* for recursion (not used here) *) 
-  vs (* parameters *) -> 
-    let param = P.d1 vs in
-    mul param (Const.i32_of_int 2)))
+let double = build (func "double" ~dump:true 
+                      i32 (P.c1 (P.combine "param" i32)) 
+                      (fun _self -> P.uncurry1 (mul (Const.i32_of_int 2))))
 
-let res = Genvalue.as_int (ExecutionEngine.run_function double (P.c1 (Genvalue.of_int i32 21)))
+let run_double = P.curry1 (ExecutionEngine.run_function double)
 
-let () = Printf.eprintf "double(21)=%d\n" res
+let run_double_ocaml x = Genvalue.as_int (run_double (Genvalue.of_int i32 x))
+
+let () = Printf.eprintf "double(21)=%d\n" (run_double_ocaml 21)