caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* module types and constraints in several layers
@ 2007-03-15 10:12 Christian Sternagel
  2007-03-15 13:25 ` [Caml-list] " Chris King
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Sternagel @ 2007-03-15 10:12 UTC (permalink / raw)
  To: caml-list

Hello all together, I have a problem using type constraints. There
are several module types in my sourcecode. Lets say

file A.mli --------
module type T = sig ...  end
-------------------

file B.mli --------
module type T = sig 
 ...
 module B1
 ... 
end
-------------------

file C.mli --------
module type T = sig ... end
-------------------

file D.mli --------
module type T = sig 
 ...
 moulde D1
 module D2
 module D3
 ...
end
-------------------

and then a couple of functors. Like

file b.ml ---------
module Make (A : A.T) : B.T = struct
 ...
 module B1 = A
 ...
end
-------------------

file d.ml ---------
module Make (B : B.T) (C : C.T) : D.T = struct
 ...
 module D1 = B.B1
 module D2 = B
 module D3 = C
 ...
end
-------------------

file e.ml ---------
module Make (D : D.T) = struct
 ...
 module E1 = D.D1
 module E2 = D.D2
 module E3 = D.D3
 module E4 = D
 ...
end
-------------------

Then I build a module like

module B = B.Make (A)
module D = D.Make (B) (C)
module E = E.make (D)

and from this point on only want to use E (so I want to access the
functions of the other modules though the submodules of E).
E.g.: 
E.E1 instead of A
E.E2 instead of B
etc...

but I was not able to tell the compiler (correctly) that after
building module E ist should be the case that for example
E.E1 = D.D1 = B.B1 = A = E4.D.D1 = E4.D.D2.B1 = ...

Is there a convenient way to make such a structure of modules?
And if yes, how ist it done?

cheers

christian


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-03-15 15:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-15 10:12 module types and constraints in several layers Christian Sternagel
2007-03-15 13:25 ` [Caml-list] " Chris King
2007-03-15 14:21   ` Christian Sternagel
2007-03-15 14:48     ` Chris King
2007-03-15 15:38       ` Christian Sternagel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).