
8 Sep
2006
8 Sep
'06
2:12 a.m.
Hello, Sometimes I find that I have two lists I want to combine, but I only want to combine them for as much as I have elements in both lists to combine and then the rest I just want to pass through unmodified. I've now found the following function useful in three different programs I've written: zipWith' :: (a -> a -> a) -> [a] -> [a] -> [a] zipWith' _ [] ys = ys zipWith' _ xs [] = xs zipWith' f (x:xs) (y:ys) = f x y : zipWith' f xs ys Does it already exist or maybe there is another natural solution to use in its place? Thanks, Jason