Can I have two mutually recursive compilation units /
structures / signatures / functors?

Currently not in the stable langage. However there
exists an OCaml
extension (which is subject to change or removal at
any time) which adresses some of these problems.

How do I express sharing constraints between modules?

Use manifest type specifications in the arguments of the
functor. For instance, assume defined the following
signatures:

To define a functormoduletypeS1 =sig...typet ...endmoduletypeS2 =sig...typeu ...end

`F`

that takes two arguments
`X:S1`

and `Y:S2`

such that `X.t`

and `Y.u`

are the same, write:
Indeed, internally this expands tomoduleF (X: S1) (Y: S2withtypeu = X.t) =struct...end

moduleF (X: S1) (Y:sig...typeu = X.t ...end) =struct...end

Compilation units are forced to be modules. What if I want
to make a unit with a functor or a signature instead?

In OCaml, functors and signatures (module types)
can be components of modules. So, just make the functor or
signature be a component of a compilation unit. A good
example is the module

`Set`

from the standard
library.