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 AAA12873; Tue, 23 Dec 2003 00:04:20 +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 AAA12503 for ; Tue, 23 Dec 2003 00:04:19 +0100 (MET) Received: from mz2.forethought.net (mzpi4.forethought.net [216.241.36.13]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id hBMN4Hv18039 for ; Tue, 23 Dec 2003 00:04:18 +0100 (MET) Received: from [216.241.35.41] (helo=swordfish) by mz2.forethought.net with esmtp (Exim 4.14) id 1AYZ60-0001ou-Nd; Mon, 22 Dec 2003 16:04:16 -0700 Received: from matt by swordfish with local (Exim 3.35 #1 (Debian)) id 1AYZ60-0000Wo-00; Mon, 22 Dec 2003 16:04:16 -0700 Date: Mon, 22 Dec 2003 16:04:15 -0700 From: Matt Gushee To: caml-list@pauillac.inria.fr Cc: Ocaml Mailing List Subject: Re: [Caml-list] Multiparameter functors? Message-ID: <20031222230415.GA1145@swordfish> Reply-To: Matt Gushee Mail-Followup-To: caml-list@pauillac.inria.fr, Ocaml Mailing List References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.27i X-Loop: caml-list@inria.fr X-Spam: no; 0.00; gushee:01 mgushee:01 havenrock:01 caml-list:01 functors:01 functors:01 orderedtype:01 orderedtype:01 struct:01 stupid:01 functor:01 functor:01 struct:01 gushee:01 englewood:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sun, Dec 21, 2003 at 07:30:27PM -0500, 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;; > > Am I being stupid and just missing something obvious, Is there anything obvious about functors? ;-) I've found the following syntax to work: module Make = functor (Key:Map.OrderedType) -> functor (Pri:Map.OrderedType) -> struct .... end;; ... though I'm not qualified to comment on the merits of doing or not doing this. -- Matt Gushee When a nation follows the Way, Englewood, Colorado, USA Horses bear manure through mgushee@havenrock.com its fields; http://www.havenrock.com/ When a nation ignores the Way, Horses bear soldiers through its streets. --Lao Tzu (Peter Merel, trans.) ------------------- 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