Suppose I have a set of modules each of which being rather "bushy" with submodules.
M1.X M2.X M3.X
M1.Y M2.Y M3.Y
M1.Z M2.Z M3.Z
M1.W M2.W M3.W
M1.Q M2.Q M3.Q
M1.P M2.P M3.P
Moreover, I'd like each of these bushes to sit under one master module.
Home.M1
Home.M2
Home.M3
Now, it's easy to structure the project directory for each of M1
, M2
, and M3
using Oasis' Pack:
option. In particular, what I like and am trying to solve for is (a) the ability to lay out my files in the standard .ml
/.mli
format and (b) having ocamldoc
produce properly linked documentation.
But since I'd like to distribute each of M1
, M2
, and M3
in the same library under a common module hierarchy I cannot use Pack:
and am instead forced to throw the whole damn thing into a single file in order to (a) not accidentally clobber the global namespace, (b) not accidentally proliferate modules all over the Home.
namespace which are not intended to be used directly, and (c) not ruin ocamldoc linking.
So my question is, subject to the goals suggested above, how can I use Oasis to create a package with hierarchical modules of this form?
Some additional constraints include:
- It is no accident that the modules under the
M1.
,M2.
, andM3.
namespaces conflict---this occurs in the genuine situation as well! - The modules in the
M2.
andM3.
namespace depend upon the modules in theM1.
namespace.
My preference would be able to arrive at a solution which also allows a sensible file layout, e.g.
src -+
+-- m1 -+
| +-- x.ml
| +-- x.mli
| +-- y.ml
| +-- y.mli
| +-- z.ml
| +-- z.mli
| |
| ...
|
|
+-- m2 -+
| +-- x.ml
| +-- x.mli
| +-- y.ml
| +-- y.mli
| +-- z.ml
| +-- z.mli
| |
| ...
|
|
+-- m3 -+
+-- x.ml
+-- x.mli
+-- y.ml
+-- y.mli
+-- z.ml
+-- z.mli
|
...
It may also be possible that this is impossible with Oasis. In such a case, suggestions as to how to use other build tools are acceptable and welcome. Assume I have very little understanding of the other tools... because it's probably true!