From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p2PJBBqV000370 for ; Fri, 25 Mar 2011 20:11:28 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnEAACTojE2LEwExkWdsb2JhbAClYRUBAQEJCwsHFAUgiE2tHwGOLwWFaQ X-IronPort-AV: E=Sophos;i="4.63,244,1299452400"; d="scan'208";a="94900642" Received: from hera.mpi-sb.mpg.de ([139.19.1.49]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES256-SHA; 25 Mar 2011 20:11:28 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mpi-sb.mpg.de; s=mail200803; h=From:To:In-Reply-To:Subject: References:Message-Id:Content-Type:Content-Transfer-Encoding: Mime-Version:Date:Cc; bh=CxX8Lg6YA05MQ6QY6PpjatCLY7VqAAoaXTYYTlL puIU=; b=noi/DR6N0BHcYnzy4Iu1koQmgwfx0K893qlPYBsneLyx/wiclQEECFT VRVR3vq1G3UroxmSJ/d+uh7S2HXlp6vLqEbApnky8bqpnBtQ25x20VzUnTVlE3gv AyH7CKPdsDJwjbLDeIL+w0yrhUFaNxOePrFWhzPfg2eqfszq08CE= Received: from infao0710.mpi-klsb.mpg.de ([139.19.1.27]:33868 helo=zak.mpi-klsb.mpg.de) by hera.mpi-sb.mpg.de (envelope-from ) with esmtp (Exim 4.69) id 1Q3CPs-0006N3-BC; Fri, 25 Mar 2011 20:11:27 +0100 Received: from mnch-5d87b711.pool.mediaways.net ([93.135.183.17]:54393 helo=[192.168.178.21]) by zak.mpi-klsb.mpg.de (envelope-from ) with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.69) id 1Q3CPr-0007BJ-Qd; Fri, 25 Mar 2011 20:11:23 +0100 From: Andreas Rossberg To: Joel Reymont In-Reply-To: <083A0142-982A-42DA-84EB-E3F5D26577E1@gmail.com> References: <083A0142-982A-42DA-84EB-E3F5D26577E1@gmail.com> Message-Id: <4C67E559-A2E4-4958-AE98-C4EA1BB89C08@mpi-sws.org> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Date: Fri, 25 Mar 2011 20:11:22 +0100 Cc: caml-list X-Mailer: Apple Mail (2.936) Subject: Re: [Caml-list] shortcut to omit the functor keyword On Mar 25, 2011, at 19.43 h, Joel Reymont wrote: > Why does the shortcut to omit the functor keyword only exists in > module definitions but not in signatures? > > For example, why do > > module type A = sig end;; > module type B = sig end;; > > module type C = functor (X : A) -> functor (Y : B) -> sig end;; > > and not > > module type C (X : A) (Y : B) = sig end;; That syntax would suggest that C is a parameterized signature that you could use like module M : C(X)(Y) But that's something entirely different from a functor signature. > the latter would be consistent with > > module C (X : A) (Y : B) = struct end;; No, it wouldn't - I'd say you are making a category error. It's easy to see in terms of core types and values, where the latter is analogous to let c x y = ... while the former would be more like type ('a, 'b) c = ... and *not* at all val c : 'a -> 'b -> ... That is, a parameterized signature would correspond to a type constructor, while a functor signature corresponds to a function type. Hope that helps, /Andreas