From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 50224BC0A for ; Thu, 15 Mar 2007 11:12:38 +0100 (CET) Received: from smtp.uibk.ac.at (lmr1.uibk.ac.at [138.232.1.142]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l2FACbuq012837 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 15 Mar 2007 11:12:38 +0100 Received: from smc.uibk.ac.at (smc.uibk.ac.at [138.232.1.226] c703350@smc.uibk.ac.at) by smtp.uibk.ac.at (8.13.8/8.13.1/F1) with ESMTP id l2FACamc028840 for ; Thu, 15 Mar 2007 11:12:36 +0100 Received: from smc.uibk.ac.at (localhost [127.0.0.1] c703350@smc.uibk.ac.at) by smc.uibk.ac.at (8.13.8+Sun/uibk) with ESMTP id l2FACaiG026560 for ; Thu, 15 Mar 2007 11:12:36 +0100 (MET) Received: (from c703350@localhost) by smc.uibk.ac.at (8.13.8+Sun/8.13.8/Submit) id l2FACa4W026559 for caml-list@yquem.inria.fr; Thu, 15 Mar 2007 11:12:36 +0100 (MET) Date: Thu, 15 Mar 2007 11:12:36 +0100 From: Christian Sternagel To: caml-list@yquem.inria.fr Subject: module types and constraints in several layers Message-ID: <20070315101236.GB3236@pc6197-c703.uibk.ac.at> Mail-Followup-To: caml-list@yquem.inria.fr Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i X-Scanned-By: MIMEDefang 2.58 at uibk.ac.at on 138.232.1.140 X-Miltered: at discorde with ID 45F91C15.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; mli:01 sig:01 mli:01 sig:01 functors:01 struct:01 struct:01 submodules:01 compiler:01 cheers:01 functions:01 modules:02 modules:02 constraints:03 constraints:03 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