caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Markus Mottl <markus.mottl@gmail.com>
To: Andreas Rossberg <rossberg@mpi-sws.org>
Cc: yminsky@gmail.com, caml-list@inria.fr
Subject: Re: [Caml-list] "with module" surprises
Date: Mon, 9 May 2011 14:56:31 -0400	[thread overview]
Message-ID: <BANLkTikHnmbU-q=H6RAanAznxxJaaDOSUQ@mail.gmail.com> (raw)
In-Reply-To: <55DBF56A-2EEF-4854-8287-EF406078078E@mpi-sws.org>

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 <rossberg@mpi-sws.org> 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


      reply	other threads:[~2011-05-09 18:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-09 14:27 Yaron Minsky
2011-05-09 15:12 ` Markus Mottl
2011-05-09 16:26   ` Yaron Minsky
2011-05-09 17:21     ` Markus Mottl
2011-05-09 17:33       ` Andreas Rossberg
2011-05-09 18:56         ` Markus Mottl [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='BANLkTikHnmbU-q=H6RAanAznxxJaaDOSUQ@mail.gmail.com' \
    --to=markus.mottl@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=rossberg@mpi-sws.org \
    --cc=yminsky@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).