laziness again...

Jay Cox
Mon, 18 Feb 2002 10:18:03 -0600 (CST)

On 18 Feb 2002, Ketil Z. Malde wrote:

> Hi,
> I'm a bit puzzled by this observatio that I made.  I have a function
> that, pseudocoded, lookes somewhat like
> f i as bs cs = ins i (f (i+1) as) ++ ins i (f (i+1) bs) ++ ins i (f (i+1) cs)
>         where ins i = manipulates the first element of the list
> Now, without the ins'es, the function appears to be lazy, i.e I can
> "take" a part of it without evalutating the rest.  With the ins'es,
> the whole thing seems to be calculated as soon as I touch it.
> Is this obvious?  Or is my observation wrong?
> -kzm

um, looks like ins i returns a function of one argument which results
in a list.  (or ins is a function of two arguments which results in a list
and ins i is just using currying;  however you want to look at it)

My question is if that function (ins i) is strict.