204
278
forAll (two $ vector n) $ \(xs, ys) ->
205
279
zipWith' f xs ys == zipWith f xs ys
207
284
-- | Like zipWith, but returns the leftover elements of the input lists.
208
285
zipWithTails :: (a -> b -> c) -> [a] -> [b] -> ([c], [a] , [b])
209
286
zipWithTails f xs [] = ([], xs, [])
210
287
zipWithTails f [] ys = ([], [] , ys)
211
288
zipWithTails f (x : xs) (y : ys) = (f x y : zs , as , bs)
212
289
where (zs , as , bs) = zipWithTails f xs ys
214
292
-- | Efficient version of nub that sorts the list first. The tag function is
215
293
-- assumed to be cheap. If it isn't pair up the elements with their tags and