From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA26843; Tue, 10 Apr 2001 15:51:28 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA26834 for ; Tue, 10 Apr 2001 15:51:26 +0200 (MET DST) Received: from mail.cs.uu.nl (sunset.cs.uu.nl [131.211.80.32]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f3ADpPb27348; Tue, 10 Apr 2001 15:51:25 +0200 (MET DST) Received: from silvester.cs.uu.nl (silvester.cs.uu.nl [131.211.80.119]) by mail.cs.uu.nl (Postfix) with SMTP id CA20E4550; Tue, 10 Apr 2001 15:51:21 +0200 (MET DST) Received: by silvester.cs.uu.nl (sSMTP sendmail emulation); Tue, 10 Apr 2001 15:51:21 +0200 Date: Tue, 10 Apr 2001 15:51:21 +0200 From: Frank Atanassow To: Dave Berry Cc: Daniel de Rauglaudre , caml-list@inria.fr Subject: Re: [Caml-list] variant with tuple arg in pattern match? Message-ID: <20010410155121.B20988@cs.uu.nl> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from Dave@kal.com on Tue, Apr 10, 2001 at 01:17:09PM +0100 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Dave Berry wrote (on 10-04-01 13:17 +0100): > You certainly can avoid currying in functional languages. Currying is a > hack that was created to keep the lambda calculus as simple as possible. When you say "currying" you are talking about a syntactic matter which arises due to positional application. When Daniel said that "currying" is basic to the lambda-calculus, he was talking about a more fundamental, semantic matter. If you look at lambda-calculus from a sufficiently abstract perspective where the syntax is immaterial, then the essential difference between a first-order and higher-order language is that in the second case you can represent a function of two arguments (or a function whose argument is a 2-tuple) as a higher-order function of one argument (and be able to apply it), and vice versa. This characterization says nothing about positional application, labels or what-have-you, because they are only a means of notation. > Daniel points out that you will always be able to return a function from > a function. But currying is a partly syntactic hack; it relies on > function application being notated by juxtaposition. Without this hack, > you have to write: > let f = g (x, y) > f (z) > instead of: > g x y z Whichever way you write it, the same thing is still going on. If your calculus is really equivalent to lambda-calculus, I should be able to transform the first example to: (g (x,y)) (z) which still uses positional application. Otherwise, you are just forcing me to name all my function terms. And how do you define g in the first case if you don't have semantical currying? You need lambda: let g = fun (x, y) -> fun z -> h(x,y,z) In a traditional denotational model, every term t is modeled as a function f from (the product of) its environment to t. To bind a free variable, say z, you need to curry f w.r.t. to z. So you still need currying to define lambda. -- Frank Atanassow, Information & Computing Sciences, Utrecht University Padualaan 14, PO Box 80.089, 3508 TB Utrecht, Netherlands Tel +31 (030) 253-3261 Fax +31 (030) 251-379 ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr