ocaml helpers