caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Derek Dreyer" <dreyer.publicity@gmail.com>
To: "Stephen Weeks" <sweeks@sweeks.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] question on type checking
Date: Wed, 21 Mar 2007 23:32:13 -0500	[thread overview]
Message-ID: <db810ed70703212132q6afd09aev367dd988788961eb@mail.gmail.com> (raw)
In-Reply-To: <604682010703211813j12529ba1h5f4931fe69dcd88f@mail.gmail.com>

Very interesting.  So now, looking back at Xavier's POPL'95 paper on
applicative functors, I see what he means by saying it's a fundamental
problem with how applicative functors work in OCaml.  I.e. it's not
just a bug in the typechecker, but in the type system in the original
paper.  In particular, the definition of signature strengthening on
page 7 of that paper includes the following case:

(module x_i : M; S)/p =
    module x_i : (M/p.x); S/p

But I believe this is a mistake, and instead of S/p it should be
  (S{x_i <- p.x})/p

In other words, first replace references to x_i (esp. in functor
applications in types) inside S with references to p.x, and then
proceed with selfification as usual.  Is there some reason this would
not work or would be difficult to implement?

I believe this would eliminate the bugs we're looking at here.  And
I'm sort of surprised that this would be hard to do, but I'm not
familiar with the implementation.

Derek

On 3/21/07, Stephen Weeks <sweeks@sweeks.com> wrote:
> Thanks for the reply Derek.  I also thought it looked like a bug, and
> your explanation makes sense.  However, Markus Mottl pointed me to the
> following  issue in the bug tracker
>
>  http://caml.inria.fr/mantis/view.php?id=3476
>
> The problem there looks very similar, and would seem to indicate that
> the situation is not viewed as a bug (in the sense that it won't be
> fixed).
>


  reply	other threads:[~2007-03-22  4:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-20 18:20 Stephen Weeks
2007-03-21 15:51 ` [Caml-list] " Derek Dreyer
2007-03-22  1:13   ` Stephen Weeks
2007-03-22  4:32     ` Derek Dreyer [this message]
2007-03-26 14:24       ` Xavier Leroy

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=db810ed70703212132q6afd09aev367dd988788961eb@mail.gmail.com \
    --to=dreyer.publicity@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=sweeks@sweeks.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).