ocamlc -i a.ml
should work; it also returns the inferred interface.
Note that even if you don't have b.cmo
, you can perfectly compile a.ml
(this is what separate compilation is about) with ocamlc -c a.ml
.
Question
I am wondering is it possible to only type-check an ml file? More precisely, I have a file a.ml
that depends on b.cmi
. How can I only type-check a.ml
? Note that I don't have b.cmo
, only b.cmi
.
Solution
ocamlc -i a.ml
should work; it also returns the inferred interface.
Note that even if you don't have b.cmo
, you can perfectly compile a.ml
(this is what separate compilation is about) with ocamlc -c a.ml
.