add some type to ocaml_of
print verbose error message for type mismatch