dune icon indicating copy to clipboard operation
dune copied to clipboard

Inferring empty mlis when they are missing

Open ddickstein opened this issue 9 months ago • 3 comments

It would be great to have a mode for libraries where the absence of an mli file means that nothing is exposed (as though an empty mli were present). There should be a way to add exceptions to this rule so that mlis aren't required for particular modules. I'm not sure whether it would be better to automatically have an exception for files that match the library name.

ddickstein avatar May 13 '25 14:05 ddickstein

Is this a duplicate of #11799?

Note that this mode already exists: you can add (empty_module_interface_if_absent) to your library, see the manual: https://dune.readthedocs.io/en/latest/reference/dune/library.html.

nojb avatar May 13 '25 14:05 nojb

It's related but not a duplicate. This is about what values are exported by default from modules; that one is about which modules are exported by default from libraries. I didn't know about empty_module_interface_if_absent, which satisfies most of this request. I'd still like to be able to exempt certain files though where I deliberately want to expose everything (useful for modules that just contain type definitions).

ddickstein avatar May 13 '25 17:05 ddickstein

I'd still like to be able to exempt certain files though where I deliberately want to expose everything (useful for modules that just contain type definitions).

A PR would be welcome, but this is kind of a niche feature, so I don't expect the maintainer team to work on it in the short term.

nojb avatar May 13 '25 19:05 nojb