caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Andrej Bauer <Andrej.Bauer@fmf.uni-lj.si>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] wrapping parameterized types
Date: Fri, 04 May 2007 14:13:24 +0200	[thread overview]
Message-ID: <463B2364.9070102@fmf.uni-lj.si> (raw)
In-Reply-To: <61164.84.165.181.194.1178279247.squirrel@www.ps.uni-sb.de>

rossberg@ps.uni-sb.de wrote:
> "skaller" <skaller@users.sourceforge.net> wrote:
>> On Thu, 2007-05-03 at 19:16 -0400, Chris King wrote:
>>> The solution is to use existential types.  In a record, you can tell
>>> O'Caml that a particular function _must_ be polymorphic:
>>>
>>> type 'b mylistfun = { listfun: 'a. 'a list -> 'b }
>> I'm still confused why this is called an existential, when
>> clearly the quantification is universal.
> 
> You have reason to be confused, because this is no existential type.
> 
> Dirk Thierbach:
>> It's because the universal quantifier is in a "negative" position,
>> which is equivalent to an existential quantifier on the outside.
>> Just pretend they are logic formulae instead of types, and then
>>
>> (\forall a. a) -> b   is equivalent to   \exists a. (a -> b)
> 
> Actually, no, these are not equivalent. Only the following are:
> 
> (\exists a. a) -> b   is equivalent to   \forall a. (a -> b)

Right, and this is in accordance with the terminology. Note that Dirk
misread the precedence of operators: in ocaml

  'a . 'a list -> 'b

means

  'a . ('a list -> 'b)

and not ('a . 'a list) -> 'b. So everything is fine. I do agree with
skaller that it is a bit perverse to call a quantifier "existential"
when it is obviously the universal quantifier, even if it is equivalent
to a formula containing an existential.

Andrej


  reply	other threads:[~2007-05-04 12:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-03 22:31 Christopher L Conway
2007-05-03 23:16 ` [Caml-list] " Chris King
2007-05-04  1:10   ` skaller
2007-05-04  8:13     ` Dirk Thierbach
2007-05-04 11:47     ` rossberg
2007-05-04 12:13       ` Andrej Bauer [this message]
2007-05-04 13:34         ` Dirk Thierbach
2007-05-04 15:58           ` Christopher L Conway
2007-05-04  1:58   ` Christopher L Conway

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=463B2364.9070102@fmf.uni-lj.si \
    --to=andrej.bauer@fmf.uni-lj.si \
    --cc=Andrej.Bauer@andrej.com \
    --cc=caml-list@yquem.inria.fr \
    /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).