From: Dario Teixeira <darioteixeira@yahoo.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Re: Generalized Algebraic Datatypes
Date: Sun, 31 Oct 2010 05:22:52 -0700 (PDT) [thread overview]
Message-ID: <792627.35144.qm@web111510.mail.gq1.yahoo.com> (raw)
In-Reply-To: <jwvvd4jf9z0.fsf-monnier+inbox@gnu.org>
Hi,
> If I misunderstood you, then I still misunderstand you: the App
> constructor you quoted took only 1 "argument" (a pair), so you can't
> "partially apply it", and that's from the type declaration.
> IOW the type declaration you quoted is *not* curried.
Now I get what you mean, and there's definitely been a misunderstanding.
First, I wasn't referring to constructor App in particular, nor confusing
a tuple argument with a curried form. I may be abusing the term, but
I used "partial application" in the most general sense, ie, including
an application with zero arguments (in other words, a first-class value).
Suppose I had the following type declaration:
val f: int -> int -> int -> int
I could do a partial application with 2 arguments:
let f2 = f 1 2
A partial application with 1 argument:
let f1 = f 1
And generalising, a "partial application" with 0 arguments, which
is simply referring to f itself:
let f0 = 0
Now, going back to the GADTs example, a declaration such as the one
below hints that the constructors may be used as first-class values
(a zero-arg "partial application"), when in fact they cannot. That
is why I find this syntax to be inconsistent with the rest of the
language.
type _ t =
| IntLit : int -> int t
| BoolLit : bool -> bool t
Best regards,
Dario Teixeira
next parent reply other threads:[~2010-10-31 12:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <jwvvd4jf9z0.fsf-monnier+inbox@gnu.org>
2010-10-31 12:22 ` Dario Teixeira [this message]
2010-10-29 14:32 [Caml-list] " Dario Teixeira
2010-10-29 21:10 ` Stefan Monnier
2010-10-29 21:37 ` [Caml-list] " bluestorm
2010-10-29 23:01 ` Jacques Le Normand
2010-10-30 5:14 ` Jacques Garrigue
2010-10-30 13:04 ` Jacques Carette
2010-10-30 13:50 ` Dario Teixeira
2010-10-31 14:15 ` Wojciech Daniel Meyer
2010-10-31 14:35 ` Sylvain Le Gall
2010-10-31 14:49 ` [Caml-list] " Lukasz Stafiniak
2010-10-31 15:08 ` Sylvain Le Gall
2010-10-31 15:31 ` [Caml-list] " Lukasz Stafiniak
2010-10-29 22:05 ` Wojciech Daniel Meyer
2010-10-30 13:35 ` Dario Teixeira
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=792627.35144.qm@web111510.mail.gq1.yahoo.com \
--to=darioteixeira@yahoo.com \
--cc=caml-list@yquem.inria.fr \
--cc=monnier@iro.umontreal.ca \
/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