Source

ocaml-logicm / tests_stream.ml

Full commit
open Tests_common

module LogicM =
  struct
    include LogicM_stream
    let ( <+> ) a b = interleave ~chunk:100 a b
    let ifteu m th el = ifteu ~alg:`Diag m th el
  end

open LogicM

type bindr = { bind : 'a 'b . ('a -> 'b m) -> 'a m -> 'b m }

let run_test ~time ~fn testfunc =
    List.iter
      (fun (alg_name, alg) ->
         Printf.printf "%s/%s\n%!" fn alg_name;
         let () = time
           (testfunc ~bindr:{bind = fun f m -> (LogicM.bind ~alg f m)}) () in
         print_newline ()
      )
      [
        ("diag50", (`Diagn 50));
        ("deep", `Deep)
      ; ("wide", `Wide)
      ]