All,

I get the sense that curried functions can be extremely useful for partial

computations. For example, as in the Paulson book,

fun infixApply x f y = f (x, y);

val reciprocal = infixApply 1.0 op/;

reciprocal 2.0;

-> val it = 0.5 : real

The infixApply function actually defines an entire class of functions. But I'd

like to see something more powerful that can be done with curried functions.

Does anyone have any killer example?

-Denis

It's such a fundamental concept that I don't think there is any 'killer

example'. Curry can simply be defined as 'curry f x = \y -> f x y'. Use it

wherever applicable.

Here's a few examples:

http://www.yqcomputer.com/ #head-5e481d64ce1e19a3618ff7c6a9aee9accc0f72e8

Mike

In article <GPJQe.148188$ XXXX@XXXXX.COM >,

Uh, that is the identity function, modulo eta. You probably meant

'curry f x y = f (x, y)' (or, more explicitly,

'curry f = \x -> \y -> f (x,y)').

Lauri

Uh, that is the identity function, modulo eta. You probably meant

'curry f x y = f (x, y)' (or, more explicitly,

'curry f = \x -> \y -> f (x,y)').

Lauri

don't know if if is a killer application, but whenever

I need similar function, I can write a general function

and then curry it.

let gen f par =

general computation

particular computation via f

let f1 =

particular computation 1

let f2 =

particular computation 2

let mypart1 = gen f1

let mypart2 = gen f2

bye

--

Gianluca Moro Visit http://www.yqcomputer.com/

XXXX@XXXXX.COM MyBlog http://www.yqcomputer.com/

Currying doesn't perform the partial evaluation you seem to be assuming

it will. Currying is only an argument passing technique. Partial

evaluation is a related but separate concern.

Check these URLs for more info:

http://www.yqcomputer.com/

http://www.yqcomputer.com/

Hope these help or are at least interesting.

it will. Currying is only an argument passing technique. Partial

evaluation is a related but separate concern.

Check these URLs for more info:

http://www.yqcomputer.com/

http://www.yqcomputer.com/

Hope these help or are at least interesting.

1. curry function implementaion

2. Currying functions (was "theory vs practice" ceases power)

4. Curried functions in JavaScript (how to employ genericly, and invisibly)?

6. A simple question about the dotted pair as an argument in a curry function

8. Currying functions (was "theory vs practice" ceases power)

11. [PHP] Bind function parameters with create_function ('currying')

12. curried and uncurried functions

13. Function Application is not Currying

14. Bind function parameters with create_function ('currying')

15. Function Application is not Currying

6 post • Page:**1** of **1**