Re: effect of order of function arguments

2003-02-19 Thread Jan-Willem Maessen
Aaron Denney <[EMAIL PROTECTED]> writes: > 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? > > i.e. > > Will any implementations notice interp y x:xs calls interp y, and keep > some sort of interp y pa

RE: effect of order of function arguments

2003-02-19 Thread Simon Peyton-Jones
| GHC used to have an optimisation for static argument like this. It would | turn both of the above programs into a similar form using a local | recursive function: | | interp y xs = interpaux xs | where interpaux [] = [] | interpaux (x:[]) = x:[] | interpaux (x:xs) = x:y:interpaux

Re: effect of order of function arguments

2003-02-19 Thread Josef Svenningsson
On Tue, 18 Feb 2003, Aaron Denney 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? > > I.e. is this: > > > interp :: a -> [a] -> [a] > > interp y [] = [] > > interp y (x:[]) = x:[] > > in

Re: effect of order of function arguments

2003-02-19 Thread Nick Name
On Tue, 18 Feb 2003 21:59:36 -0800 Aaron Denney <[EMAIL PROTECTED]> 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 th

Re: effect of order of function arguments

2003-02-19 Thread Malcolm Wallace
Aaron Denney <[EMAIL PROTECTED]> writes: > 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? i.e. > Will any implementations notice interp y x:xs calls interp y, and keep > some sort of interp y par