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
| 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
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
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
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