From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA22537; Tue, 3 Aug 2004 14:43:05 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA21085 for ; Tue, 3 Aug 2004 14:43:03 +0200 (MET DST) Received: from indyio.rz.uni-saarland.de (indyio.rz.uni-saarland.de [134.96.7.3]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i73Ch2EV024659 for ; Tue, 3 Aug 2004 14:43:03 +0200 Received: from cs.uni-sb.de (cs.uni-sb.de [134.96.254.254]) by indyio.rz.uni-saarland.de (8.12.10/8.12.10) with ESMTP id i73Ch1tY30588650 for ; Tue, 3 Aug 2004 14:43:01 +0200 (CST) Received: from mail.cs.uni-sb.de (mail.cs.uni-sb.de [134.96.254.200]) by cs.uni-sb.de (8.13.0/2004062200) with ESMTP id i73Ch0oH010594 for ; Tue, 3 Aug 2004 14:43:00 +0200 (CEST) Received: from ps.uni-sb.de (grizzly.ps.uni-sb.de [134.96.186.68]) by mail.cs.uni-sb.de (8.13.1/2004080200) with ESMTP id i73CgxNR025978 for ; Tue, 3 Aug 2004 14:42:59 +0200 (CEST) X-Authentication-Warning: email: Host grizzly.ps.uni-sb.de [134.96.186.68] claimed to be ps.uni-sb.de Received: from ps.uni-sb.de (groove.ps.uni-sb.de [134.96.186.172]) by ps.uni-sb.de (8.12.10/8.12.10) with ESMTP id i73Cgw9x012652; Tue, 3 Aug 2004 14:42:58 +0200 Message-ID: <410F8852.30001@ps.uni-sb.de> Date: Tue, 03 Aug 2004 14:42:58 +0200 From: Andreas Rossberg User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031114 X-Accept-Language: en-us, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] using arguments insides functors References: <20040803.205025.104127434.keiko@kaba.or.jp> In-Reply-To: <20040803.205025.104127434.keiko@kaba.or.jp> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.5.1 (indyio.rz.uni-saarland.de [134.96.7.3]); Tue, 03 Aug 2004 14:43:01 +0200 (CEST) X-AntiVirus: checked by AntiVir Milter 1.0.6; AVE 6.26.0.10; VDF 6.26.0.57 X-Miltered: at nez-perce with ID 410F8856.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; rossberg:01 rossberg:01 uni-sb:01 caml-list:01 functors:01 functor:01 elt:01 struct:01 elt:01 functor:01 struct:01 uni-sb:01 sig:01 sig:01 modules:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk nakata keiko wrote: > why the following code does not get type checked ? > > module type I = > sig > module type T > end > > module F = functor (Elt : I) -> > struct > module type T = Elt.T > module F = functor (Elt : T) -> > struct > include Elt > end > end Because "include" only applies to modules that are structures, since it is meant to copy its fields to the current scope. In your example however, Elt has some abstract module type T, so it does not meet that requirement. What should the include mean if you applied the outer F like F (struct module type T = functor (X : sig end) -> sig end end) ? And how could you express the result type of F without knowing the structure of Elt? Cheers, - Andreas -- Andreas Rossberg, rossberg@ps.uni-sb.de Let's get rid of those possible thingies! -- TB ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners