caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Lukasz Stafiniak <lukstafi@gmail.com>
To: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Existential types
Date: Mon, 5 Sep 2005 14:26:15 +0200	[thread overview]
Message-ID: <4a708d205090505266800ae48@mail.gmail.com> (raw)
In-Reply-To: <20050905.082839.104027887.garrigue@math.nagoya-u.ac.jp>

Nice to know, that this is a standard technique.

2005/9/5, Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>:
> [...]
> And if this is not the case (i.e. implemented in ocaml but magic
> required), there is a serious risk that this is actually unsound.
> Remember that the function Obj.repr of type ['a -> Obj.t] is unsound,
> contrary to the intuition.
> Which leads to the rule of thumb: the only "safe" uses of  magic are
> when dealing with "unsafe" values (implemented in C.)

Yes, they are custom values wrapping pointers to C++ objects related
by inheritance.
> 
> By the way, I'm not sure I would call this existantial quantification,
> as it is only one-way. This looks more like a simple form of
> subtyping.
> 
I agree, it is by no means a constructive existential quantification,
and it is a simple form of subtyping based on polymorphism. The
similarity to <exists 'a. 'a t> may be misleading here.

Thank You,
Lukasz


      reply	other threads:[~2005-09-05 12:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-04 19:43 Lukasz Stafiniak
2005-09-04 23:28 ` [Caml-list] " Jacques Garrigue
2005-09-05 12:26   ` Lukasz Stafiniak [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=4a708d205090505266800ae48@mail.gmail.com \
    --to=lukstafi@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=garrigue@math.nagoya-u.ac.jp \
    /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).