caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Christian Sternagel <christian.sternagel@uibk.ac.at>
To: caml-list@yquem.inria.fr
Subject: module types and constraints in several layers
Date: Thu, 15 Mar 2007 11:12:36 +0100	[thread overview]
Message-ID: <20070315101236.GB3236@pc6197-c703.uibk.ac.at> (raw)

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


             reply	other threads:[~2007-03-15 10:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-15 10:12 Christian Sternagel [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070315101236.GB3236@pc6197-c703.uibk.ac.at \
    --to=christian.sternagel@uibk.ac.at \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).