There are three situations I’m thinking of:
-
You have defined some type in your implementation file but wish to keep it’s implementation abstract. Here you would use an .mli file to hide the implementation.
-
Your .ml file just contains a module signature; you see this throughout Jane Street’s base and they don’t include an .mli for these ‘[X]_intf.ml’ files
-
You have an implementation file but it’s interface would be exactly that determined by
module type of .... The particular example I’m thinking of is here.
In case number three, is there any advantage to explicitly having the signatures of the modules you are exporting from a libraries top-level file?