[RFC] partial evaluation / higher order functions
  Home FAQ Contact Sign in
comp.lang.functional only
 
Advanced search
POPULAR GROUPS

more...

comp.lang.functional Profile…
 Up
[RFC] partial evaluation / higher order functions         


Author: Didier Verna
Date: Jun 24, 2008 04:55

Hi,

we know the notion of 1st class object, which, applied to functions
means things like being able to give functions as other
functions'arguments, return functions, aggregate them, using them
literally and so on.

What about partial application and the fact that if you define "f a b",
them "f a" also denotes a function that you can later apply to another
argument? Would you say that this is one of the caracteristics of
functions being 1st class objects, or rather that it is a /consequence/
of that?

Since partial application is very function-specific (as opposed to
concepts like litteral manipulation or function arguments/return
values), I'm reluctant to consider it as a higher order characteristic,
but I'd like other opinions.

--
5th European Lisp Workshop at ECOOP 2008, July 7: http://elw.bknr.net/2008/

Didier Verna, didier@lrde.epita.fr, http://www.lrde.epita.fr/~didier

EPITA / LRDE, 14-16 rue Voltaire Tel.+33 (0)1 44 08 01 85
94276 Le Kremlin-Bicêtre, France Fax.+33 (0)1 53 14 59 22 didier@xemacs.org
2 Comments
Re: [RFC] partial evaluation / higher order functions         


Author: Mark Wooding
Date: Jun 24, 2008 15:13

Didier Verna wrote:
> What about partial application and the fact that if you define "f a b",
> them "f a" also denotes a function that you can later apply to another
> argument?

Partial application is not at all the same as partial evaluation. The
former is a language feature which makes certain kinds of programs more
concise. The latter is a kind of compiler optimization.
> Would you say that this is one of the caracteristics of functions
> being 1st class objects, or rather that it is a /consequence/ of that?

Consider Scheme here.

-- [mdw]
no comments
Re: [RFC] partial evaluation / higher order functions         


Author: Torben Ægidius Mogensen
Date: Jun 25, 2008 01:16

Didier Verna writes:
> What about partial application and the fact that if you define "f a b",
> them "f a" also denotes a function that you can later apply to another
> argument? Would you say that this is one of the caracteristics of
> functions being 1st class objects, or rather that it is a /consequence/
> of that?

Partial application is not really different from full application when
you look underneath the syntactic sugar. A function

f a b = e

is really a shorthand for

f = \a->\b->e

So you define a function that takes a value a and returns another
function that takes a value b and returns a value (which may or may
not be another function).

So, if you can define functions that return functions, you have the
ability to do partial applications. So I would say that partial
application is a consequence of first-class functions. You might not
always have as nice a syntax as the above, though.

Torben
no comments

RELATED THREADS
SubjectArticles qty Group
Bug#377602: doc-rfc: a lot of RFCs are missinglinux.debian.bugs.dist ·