change of strictness in zipWith

Roman Cheplyaka roma at ro-che.info
Fri Jan 2 10:07:54 UTC 2015


I don't think it does. The first pattern (a:as) will be refuted, and the
second (b:bs) won't try to match at all.

On 02/01/15 12:00, Henning Thielemann wrote:
> 
> On Fri, 2 Jan 2015, Roman Cheplyaka wrote:
> 
>> This is a big deal. That's a very common pattern.
> 
> However, I checked the Haskell 98 report (chapter 8, standard Prelude,
> PreludeList, page 120 in the PDF) and found that the new behaviour
> matches the specified one:
> 
> zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
> zipWith z (a:as) (b:bs) = z a b : zipWith z as bs
> zipWith _ _ _ = []
> 



More information about the Libraries mailing list