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 AAA14410; Tue, 23 Dec 2003 00:44:50 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 AAA13694 for ; Tue, 23 Dec 2003 00:44:49 +0100 (MET) Received: from postfix1-1.free.fr (postfix1-1.free.fr [213.228.0.2]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id hBMNimv20937 for ; Tue, 23 Dec 2003 00:44:48 +0100 (MET) Received: from postfix4-2.free.fr (postfix4-2.free.fr [213.228.0.176]) by postfix1-1.free.fr (Postfix) with ESMTP id D81C3E8458 for ; Mon, 22 Dec 2003 13:39:47 +0100 (CET) Received: from free.fr (lns-vlq-3-82-64-200-96.adsl.proxad.net [82.64.200.96]) by postfix4-2.free.fr (Postfix) with ESMTP id 5E2D330496; Mon, 22 Dec 2003 13:38:16 +0100 (CET) Message-ID: <3FE6E542.8000301@free.fr> Date: Mon, 22 Dec 2003 12:36:18 +0000 From: Julien Demouth User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20031119 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Brian Hurt , Caml List Subject: Re: [Caml-list] Multiparameter functors? References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 functors:01 functors:01 orderedtype:01 orderedtype:01 struct:01 functor:01 stupid:01 sig:01 sig:01 module:03 module:03 wrote:03 functions:05 structure:06 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Hi, Brian Hurt wrote: > Is it possible to do multi-parameter functors? What I want to be able to > so is something like: > > module Make(Key: Map.OrderedType, Pri: Map.OrderedType) = struct > type key = Key.t;; > type pri = Pri.t;; > ... > end;; Of course it's possible but you mustn't use the comma. A functor is just a function. The only difference is that it deals with structure whereas "normal" functions deal with values. Consider the following example: module type M = sig type t end module type N = sig type t end module type R = sig type u and v end module Make (U:M) (V:N) : R with type u = U.t and type v = V.t > Am I being stupid and just missing something obvious, or is there some > subtle reason why I shouldn't be doing this? Every question is good to be asked ;) Regards, Julien ------------------- 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