what the ocaml implementation should look like