From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 0BD04BB81 for ; Sat, 20 Nov 2004 21:34:24 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iAKKYNre002291 for ; Sat, 20 Nov 2004 21:34:23 +0100 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 VAA29432 for ; Sat, 20 Nov 2004 21:34:23 +0100 (MET) Received: from mailfe05.swip.net (mailfe05.swip.net [212.247.154.129]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iAKKYMnO002288 for ; Sat, 20 Nov 2004 21:34:22 +0100 X-T2-Posting-ID: 2IIuXFmkcTpj3lKEFKW25A== Received: from [83.176.173.52] (HELO poincare) by mailfe05.swip.net (CommuniGate Pro SMTP 4.2.6) with ESMTP id 29100389; Sat, 20 Nov 2004 21:34:21 +0100 Received: from poincare ([127.0.0.1] helo=localhost ident=trch) by poincare with esmtp (Exim 3.36 #1 (Debian)) id 1CVW51-0001ma-00; Sat, 20 Nov 2004 15:19:11 +0100 Date: Sat, 20 Nov 2004 15:19:10 +0100 (CET) Message-Id: <20041120.151910.94589743.debian00@tiscali.be> To: jfh@cs.brown.edu Cc: caml-list@inria.fr Subject: Re: [Caml-list] A second functor question From: Christophe TROESTLER In-Reply-To: <20041120041446.JDEC13256.lakermmtao10.cox.net@SPIKESHOMEPC> References: <20041120041446.JDEC13256.lakermmtao10.cox.net@SPIKESHOMEPC> Organization: None X-Spook: rail gun Sears Tower smuggle Cocaine Leitrim Indigo AVN AUTODIN Bellcore red noise X-Blessing: Om Ah Hum Vajra Guru Pema Siddhi Hum X-Operating-System: GNU/Linux (http://www.linux.org/) X-Mailer-URL: http://www.mew.org/ X-Mailer: Mew version 4.1 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 419FAA4F.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 419FAA4E.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 functor:01 christophe:01 troestler:01 wrote:01 sig:01 val:01 foo:01 val:01 functor:01 struct:01 foo:01 ...:98 ...:98 functions:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.5 required=5.0 tests=FROM_ENDS_IN_NUMS autolearn=disabled version=3.0.0 X-Spam-Level: On Fri, 19 Nov 2004, "John F. Hughes" wrote: > > I'd like to write a signature like this: > > module type P = > sig > type t > val foo : t -> t > val z:int > end;; > > I now want to apply a functor to those two modules...but a functor > wants a single module, Just like functions want a single argument. > module type COMBINE = This is unnecessary. > I'd like a way to promise to the type system that A.t and B.t are > always the same. Does this fit your needs: module F(A : P) (B : P with type t = A.t) = struct let f x = A.foo(B.foo x) (* ... *) end ChriS