From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p49IuUfC007848 for ; Mon, 9 May 2011 20:56:33 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq8CAB04yE3RVdU2imdsb2JhbACleQgUAQEBCgkNBxIGIaoyjBmCMYURNohfAQEDBoYGBI9liECCMTuDTQ X-IronPort-AV: E=Sophos;i="4.64,341,1301868000"; d="scan'208";a="107925396" Received: from mail-yw0-f54.google.com ([209.85.213.54]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 09 May 2011 20:56:32 +0200 Received: by ywf7 with SMTP id 7so3141671ywf.27 for ; Mon, 09 May 2011 11:56:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Hoa0n+7tiKphn6F+YMPMOoc5jLh/watj+pNA9f+pVQs=; b=o73+R5+0jePDHSOIdMCg2048yxJtPRCbcDD/MTfORNo/aA7DZ/GnomPh/AlV0pmt+D hsCN8OwVOPU+v7c+Gysh2KamBsA3oxYkUgRgCVkjmKiOExpL+57o6HtW1z1tz0P62QOi jBRnX0CpxFI3NmVVBChnT7zXHMI8x5OCfhXLA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=hC3LOPyR0frRZMgxCkiPFCOFfC54T9GoG9huHFv4QajsbcynefmZvYdkLAFlKHL04J +TJzs2xGsfcTIN7hrYfyrtcV2ZCTvGwvsi8JSgfDqC4yIiPuMUnaklN+kjEaVzlVVpVf 5PVBWwSxgk+PQ+6Xi5OhoKWe+JixrfdMQAcWc= MIME-Version: 1.0 Received: by 10.151.28.19 with SMTP id f19mr6377654ybj.233.1304967391278; Mon, 09 May 2011 11:56:31 -0700 (PDT) Received: by 10.147.178.15 with HTTP; Mon, 9 May 2011 11:56:31 -0700 (PDT) In-Reply-To: <55DBF56A-2EEF-4854-8287-EF406078078E@mpi-sws.org> References: <20110509142702.GZ28842@janestreet.com> <55DBF56A-2EEF-4854-8287-EF406078078E@mpi-sws.org> Date: Mon, 9 May 2011 14:56:31 -0400 Message-ID: From: Markus Mottl To: Andreas Rossberg Cc: yminsky@gmail.com, caml-list@inria.fr Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p49IuUfC007848 Subject: Re: [Caml-list] "with module" surprises If "S" referred to "ARG" as signature for "Spec", too, then you are right, and that's probably by far the usual case. You could still export anything in "ARG" that's not in the signature for "Spec" imposed by "S". But I agree this example is not nearly as useful as it might seem. Not sure I have ever depended on this feature in actual code. If so, this must be exceedingly rare, but semantically it still seems like the right behavior to me. Markus On Mon, May 9, 2011 at 13:33, Andreas Rossberg wrote: > On May 9, 2011, at 19.21 h, Markus Mottl wrote: >> >> A use case for the intended semantics might be reexporting of functor >> arguments: >> >>  module Make (Arg : ARG) : S with module Spec = Arg = struct >>   module Spec = Arg >>   ... >>  end >> >> It could be bad from a design perspective to lose substructures in >> "Spec" which were unknown to "S". > > If I understand your example correctly, then I don't think it does what you > think it does. That is, if you apply Make to some M that is wider than ARG, > you still won't have the additional components in F(M).Spec, because M gets > narrowed to ARG by the functor application anyway. > > /Andreas > > -- Markus Mottl        http://www.ocaml.info        markus.mottl@gmail.com