effect of order of function arguments

Nick Name nick.name@inwind.it
Wed, 19 Feb 2003 13:50:44 +0100


On Tue, 18 Feb 2003 21:59:36 -0800
Aaron Denney <wnoise@ofb.net> wrote:

> 
>  With a recursive function of more than one argument, does it make
>  sense to keep the arguments that tend to remain constant closer to
>  the front?

At least it is easier to use: if the list argument in foldr was the
first, you ought to write 

f (\ x -> foldr x (+) 0) 

instead of 

f (foldr (+) 0)

Choosing the argument that is "less variable" as the first argument of a
function saves typing and cleans up code.

Vincenzo



-- 
Teatri vuoti e inutili potrebbero affollarsi
se tu ti proponessi di recitare te
[CCCP]