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=1.0 required=5.0 tests=AWL,SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 6933ABC69 for ; Thu, 22 Mar 2007 17:12:17 +0100 (CET) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.241]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l2MGCFq1024217 for ; Thu, 22 Mar 2007 17:12:16 +0100 Received: by an-out-0708.google.com with SMTP id c24so824675ana for ; Thu, 22 Mar 2007 09:12:14 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; b=RaSNwMDNwb3045g/kZGZ630GdwHlG38MzwQILUii8dCtkT4+ALE1WJ5syQM4rNODf2hbZBP+kX17p0puxbslXtOwTwOTq4Ewc+VbQFqyXiNy+I+N15E9EBU6zTg19b3yuHFEGU7Cv2BTtqABuD5h4XevnlMzZx6VqDoKq0yq0zo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition:x-google-sender-auth; b=qaouqtkb6hpHHelFsOXeqnGSZ2BE7zpW44uOGnLKvsu8eR9qN0a+gcE58Md2/LXjEX5TezltZNP8m4uX8gbYVucJtyPqN0O0syaUt18rgjdLvIhiq7/41R7qt0X2wY4lP6+/BbrmceZeIktLH4wsTpXyQEsXkg3IpugiHhWqIR0= Received: by 10.100.198.11 with SMTP id v11mr1763663anf.1174579934402; Thu, 22 Mar 2007 09:12:14 -0700 (PDT) Received: by 10.100.133.18 with HTTP; Thu, 22 Mar 2007 09:12:14 -0700 (PDT) Message-ID: <604682010703220912m1f6ecfay84b3ffacd53f50db@mail.gmail.com> Date: Thu, 22 Mar 2007 12:12:14 -0400 From: "Stephen Weeks" Sender: stephentweeks@gmail.com To: caml-list@yquem.inria.fr Subject: question about "with module" MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Google-Sender-Auth: 1715b209bf34c63e X-Miltered: at discorde with ID 4602AADF.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; typecheck:01 sig:01 sig:01 val:01 struct:01 constraint:01 int:01 caml:02 module:03 module:03 let:03 structure:06 manual:06 manual:06 docs:06 Why does this program typecheck? ------------------------------------------------------------ module type S = sig module A : sig val x : int end module Z : sig module B : sig end end with module B = A end module F (S : S) = struct let _ = S.Z.B.x end ------------------------------------------------------------ The explanation of "with module" in the manual: http://caml.inria.fr/pub/docs/manual-ocaml/manual018.html says: The constraint module module-path = extended-module-path adds type equations to all type components of the sub-structure denoted by module-path, making them equivalent to the corresponding type components of the structure denoted by extended-module-path. It doesn't say anything about adding value components.