Re: Strict functions

2001-10-21 Thread Ian Lynagh
On Sat, Oct 20, 2001 at 01:11:05AM +1000, Andrew J Bromage wrote: G'day all. On Fri, Oct 19, 2001 at 02:30:59PM +0100, Ian Lynagh wrote: Also, the prelude definition of zipWith has LVL whereas the following definition has LVV. Why is something like the following not used? zipWith

Re: Strict functions

2001-10-21 Thread Jon Fairbairn
If xs is finite, your version of zipWith would evaluate the infinite list [1..] one place beyond that which was really needed. Sure, there is a single extra amount of evaluation needed to work out if there is a following list item (I guess this could be quite high in more complex cases -

Strict functions

2001-10-19 Thread Ian Lynagh
Hi all I've been reading the GHC docs and they say that strict functions are good for space and time. Section 6.2 goes on to explain how to read the .hi files to determine the strictness of a function. However, it doesn't explain all the cases I am seeing. Example of the ones I've noticed

Re: Strict functions

2001-10-19 Thread Andrew J Bromage
G'day all. On Fri, Oct 19, 2001 at 02:30:59PM +0100, Ian Lynagh wrote: Also, the prelude definition of zipWith has LVL whereas the following definition has LVV. Why is something like the following not used? zipWith :: (a-b-c) - [a] - [b] - [c] zipWith f (a:as) (b:bs) = f