Jeffrey R. Lewis wrote:

 | Hmm... indeed.   I wonder if there's any reason why zipWith can't just be fully lazy
 | so that we don't need to twiddle with transpose.  I.e., define it as:
 | 
 |     zipWith                   :: (a->b->c) -> [a]->[b]->[c]
 |     zipWith z ~(a:as) ~(b:bs) = z a b : zipWith z as bs
 |     zipWith _ _      _        = []

You cannot do this, since the first line of the definition will now
_always_ match. This means that you get an error when zipWith reaches
at least one empty list.

Regards,
Koen.

--
Koen Claessen,
[EMAIL PROTECTED],
http://www.cs.chalmers.se/~koen,
Chalmers University of Technology.


Reply via email to