caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Arnaud Spiwack <Arnaud.Spiwack@lix.polytechnique.fr>
To: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
Cc: Philippe Veber <philippe.veber@gmail.com>,
	caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] Narrowing a signature with a constrained type
Date: Mon, 29 Jul 2013 10:51:49 +0200	[thread overview]
Message-ID: <CAMoPVjeACBSQZgRpPHX94V2wvMRYRqZH-Xs0xsLsbKYgvk3M0A@mail.gmail.com> (raw)
In-Reply-To: <059C2901-8AFE-4E28-B1D2-BC1D660CCA3A@math.nagoya-u.ac.jp>

[-- Attachment #1: Type: text/plain, Size: 815 bytes --]

>
> Well, to ensure the coherence of the with constraints, we require that
> the new signature be a subtype of the original one (as a module, not as an
> object).
> This is where your code gets rejected.
>
> Now why is it deemed unsafe to allow a constrained type definition to be a
> subtype of
> an unconstrained one?
> Actually, I don't know.
> The unconstrained type does not enforce the invariants of the constrained
> one,
> but they will be checked as soon as you try to unify the two.
> So it may be possible to lift this restriction.
>

It sounds pretty unlikely. If I have a functor taking a T in argument and I
pass it a T with constraints, it's likely to be inconsistent.

May I wonder, though, about the reason why T with blah should be a subtype
of T? I must confess I fail to see the point.


Arnaud

[-- Attachment #2: Type: text/html, Size: 1173 bytes --]

      parent reply	other threads:[~2013-07-29  8:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-26 13:32 Philippe Veber
2013-07-26 23:35 ` Jacques Garrigue
2013-07-27 20:07   ` Philippe Veber
2013-07-29  8:51   ` Arnaud Spiwack [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=CAMoPVjeACBSQZgRpPHX94V2wvMRYRqZH-Xs0xsLsbKYgvk3M0A@mail.gmail.com \
    --to=arnaud.spiwack@lix.polytechnique.fr \
    --cc=caml-list@inria.fr \
    --cc=garrigue@math.nagoya-u.ac.jp \
    --cc=philippe.veber@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).