From: rossberg@ps.uni-sb.de
To: caml-list@yquem.inria.fr
Cc: "Chris King" <colanderman@gmail.com>,
"skaller" <skaller@users.sourceforge.net>
Subject: Re: [Caml-list] wrapping parameterized types
Date: Fri, 4 May 2007 13:47:27 +0200 (CEST) [thread overview]
Message-ID: <61164.84.165.181.194.1178279247.squirrel@www.ps.uni-sb.de> (raw)
In-Reply-To: <1178241003.7436.10.camel@rosella.wigram>
"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)
Here is the constructive proof. Assume:
f : (exists a.a) -> b
g : forall a. (a -> b)
You can construct g from f and vice versa:
g = \a. \a:x. f <a,x>
f = \y:(exists a.a). let <a,x> = y in g a x
Cheers,
- Andreas
next prev parent reply other threads:[~2007-05-04 11:47 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 [this message]
2007-05-04 12:13 ` Andrej Bauer
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=61164.84.165.181.194.1178279247.squirrel@www.ps.uni-sb.de \
--to=rossberg@ps.uni-sb.de \
--cc=caml-list@yquem.inria.fr \
--cc=colanderman@gmail.com \
--cc=skaller@users.sourceforge.net \
/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).