caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: qrczak@knm.org.pl (Marcin 'Qrczak' Kowalczyk)
To: caml-list@inria.fr
Subject: Re: [Caml-list] variant with tuple arg in pattern match?
Date: 10 Apr 2001 23:16:19 GMT	[thread overview]
Message-ID: <slrn9d7522.h0t.qrczak@qrnik.zagroda> (raw)
In-Reply-To: <DD7356599083414BA450E3DCC4119B8B06C4DE@NT.kal.com>

Tue, 10 Apr 2001 18:25:27 +0100, Dave Berry <Dave@kal.com> pisze:

> There are two levels of semantics here.  At the higher level, we have
> the behaviour that the programmer is trying to communicate, which
> distinguishes returning a function as a result on the one hand from
> passing multiple arguments on the other.

Sometimes it distinguishes that, sometimes not.

Cases when they are not distinguished seems to be common among
functions taking functions as *arguments*. Consider
    let flip f x y = f y x
How would you write it in the uncurried style?
    let flip (f,x,y) = f y x
    let flip (f,x,y) = f (y,x)
    let flip f = fun (x,y) -> f y x
    let flip f = fun (x,y) -> f (y,x)
    let flip (f,x) -> fun y -> f y x
    let flip (f,x) -> fun y -> f (y,x)

It tries to distinguish too much. flip transforms a binary function
to a function which takes its arguments in the opposite order. flip
transforms a multi-argument function to let it take its first two
arguments in the opposite order. flip takes a binary function with
its second argument and returns the appropriate partial application.
flip takes a binary function and its arguments and applies the function
to the arguments in the opposite order.

All these interpretations are correct. They describe the same thing
in different ways. I see no point in being forced to distinguish them.

> The lower level is how this is encoded in the programming language.
> With currying, there is no difference between the two, so information
> has been lost.  With multiple arguments, the distinction is
> maintained.

I would say the opposite. The uncurried style requires to introduce
some grouping of arguments. This grouping is not necessarily inherent
to the problem at hand. The concrete syntax introduced an unnecessary
distinction.

-- 
 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK

-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


  reply	other threads:[~2001-04-10 23:37 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-10 17:25 Dave Berry
2001-04-10 23:16 ` Marcin 'Qrczak' Kowalczyk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-04-10 17:33 Dave Berry
2001-04-10 22:34 ` John Prevost
2001-04-10 12:17 Dave Berry
2001-04-10 13:12 ` Marcin 'Qrczak' Kowalczyk
2001-04-10 21:26   ` Bruce Hoult
2001-04-10 22:34     ` John Prevost
2001-04-10 13:51 ` Frank Atanassow
2001-04-08  0:22 jgm
2001-04-04 11:04 Chris Hecker
2001-04-04 18:47 ` Alain Frisch
2001-04-04 19:18 ` Patrick M Doane
2001-04-04 19:36   ` Chris Hecker
2001-04-04 19:49     ` Daniel de Rauglaudre
2001-04-05  8:19       ` Christian RINDERKNECHT
2001-04-04 19:49     ` Patrick M Doane
2001-04-06 13:52   ` Xavier Leroy
2001-04-07  1:42     ` Patrick M Doane
2001-04-07  6:44       ` Daniel de Rauglaudre
2001-04-07  7:42     ` Fergus Henderson
2001-04-08 19:45       ` Pierre Weis
2001-04-08 20:37         ` Charles Martin
2001-04-08 23:57         ` Brian Rogoff
2001-04-09  0:22           ` Alain Frisch
2001-04-09 16:07             ` Pierre Weis
2001-04-10  8:23               ` Michel Mauny
2001-04-10  9:14                 ` Xavier Leroy
2001-04-10 10:09                   ` Michel Mauny
2001-04-10 10:44                 ` reig
2001-04-10 11:32                   ` Michel Mauny
2001-04-10 11:47                     ` reig
2001-04-10 12:10                       ` reig
2001-04-10 12:35                         ` Michel Mauny
2001-04-10 12:49                         ` Marcin 'Qrczak' Kowalczyk
2001-04-09  6:23           ` Mattias Waldau
2001-04-09  7:34             ` Daniel de Rauglaudre
2001-04-09 15:57           ` Pierre Weis
2001-04-10  9:07             ` Sven LUTHER
2001-04-09  8:20         ` Christian RINDERKNECHT
2001-04-10  2:54         ` Patrick M Doane
2001-04-10 19:04           ` John Max Skaller

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=slrn9d7522.h0t.qrczak@qrnik.zagroda \
    --to=qrczak@knm.org.pl \
    --cc=caml-list@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).