A stew of OCaml utility function