caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
To: Gabriel Scherer <gabriel.scherer@gmail.com>
Cc: Carl Eastlund <ceastlund@janestreet.com>,
	OCaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] Weird type error involving 'include' and applicative functors
Date: Tue, 24 Feb 2015 14:54:39 +0900	[thread overview]
Message-ID: <7F37BBAA-D80E-4EE1-BFEE-1136E10A9BB5@math.nagoya-u.ac.jp> (raw)
In-Reply-To: <B9663FA4-652C-4D85-B1A5-104E4E5ABAD1@math.nagoya-u.ac.jp>

On 2015/02/24 13:38, Jacques Garrigue <garrigue@math.nagoya-u.ac.jp> wrote:

>  While logically the T inside C and C.T are the same module,
> the typing rule in Leroy's paper do not say anything like that.
> 
> σ : {1,...,m} 􏰀→ {1,...,n} for all i ∈ {1,...,m}, E;D1;...;Dn ⊢ Dσ(i) <: Di′
> ---------------------------------------------------------------------------------------
>          E ⊢ sig D1;…;Dn end <: sig D1′ ;...;Dm′ end
> 
> The definition in the premise must match without extra equations.
> Here module aliases do not help.
> What could help would be to strengthen the definitions in the premise, so
> that T would be converted to C.T. But I don't know whether this is sound
> or not, since this is not part of the current theory.

More precisely, OCaml actually does a bit more than this rule, as it
strengthens abstract types. However there is no such thing as strengthening
for module aliases, as this would require having both a signature and an
alias for the same module. Allowing that could help solve this problem, but
this is not fixing a bug, rather extending the theory.

Jacques Garrigue



      reply	other threads:[~2015-02-24  5:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-13 21:40 Carl Eastlund
2015-02-15 10:26 ` Gabriel Scherer
2015-02-16 18:03   ` Leo White
2015-02-17 21:40     ` Milan Stanojević
2015-02-19 18:21       ` Milan Stanojević
2015-02-19 18:23         ` Milan Stanojević
2015-02-24  4:38   ` Jacques Garrigue
2015-02-24  5:54     ` Jacques Garrigue [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=7F37BBAA-D80E-4EE1-BFEE-1136E10A9BB5@math.nagoya-u.ac.jp \
    --to=garrigue@math.nagoya-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=ceastlund@janestreet.com \
    --cc=gabriel.scherer@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).