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.

Was it helpful?

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top