Hoogle Search
Within LTS Haskell 24.25 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]relude Relude.List.Reexport zipWith generalises zip by zipping with the function given as the first argument, instead of a tupling function.
zipWith (,) xs ys == zip xs ys zipWith f [x1,x2,x3..] [y1,y2,y3..] == [f x1 y1, f x2 y2, f x3 y3..]
zipWith is right-lazy:>>> let f = undefined >>> zipWith f [] undefined []
zipWith is capable of list fusion, but it is restricted to its first list argument and its resulting list.Examples
zipWith (+) can be applied to two lists to produce the list of corresponding sums:>>> zipWith (+) [1, 2, 3] [4, 5, 6] [5,7,9]
>>> zipWith (++) ["hello ", "foo"] ["world!", "bar"] ["hello world!","foobar"]
cartesianProduct :: (a -> b -> c) -> [a] -> [b] -> [c]universe-base Data.Universe.Helpers Slightly unfair 2-way Cartesian product: given two (possibly infinite) lists, produce a single list such that whenever v and w have finite indices in the input lists, (v,w) has finite index in the output list. Lower indices occur as the fst part of the tuple more frequently, but not exponentially so.
unfairCartesianProduct :: (a -> b -> c) -> [a] -> [b] -> [c]universe-base Data.Universe.Helpers Very unfair 2-way Cartesian product: same guarantee as the slightly unfair one, except that lower indices may occur as the fst part of the tuple exponentially more frequently.
zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]ghc-internal GHC.Internal.Data.List zipWith generalises zip by zipping with the function given as the first argument, instead of a tupling function.
zipWith (,) xs ys == zip xs ys zipWith f [x1,x2,x3..] [y1,y2,y3..] == [f x1 y1, f x2 y2, f x3 y3..]
zipWith is right-lazy:>>> let f = undefined >>> zipWith f [] undefined []
zipWith is capable of list fusion, but it is restricted to its first list argument and its resulting list.Examples
zipWith (+) can be applied to two lists to produce the list of corresponding sums:>>> zipWith (+) [1, 2, 3] [4, 5, 6] [5,7,9]
>>> zipWith (++) ["hello ", "foo"] ["world!", "bar"] ["hello world!","foobar"]
zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]ghc-internal GHC.Internal.Data.OldList zipWith generalises zip by zipping with the function given as the first argument, instead of a tupling function.
zipWith (,) xs ys == zip xs ys zipWith f [x1,x2,x3..] [y1,y2,y3..] == [f x1 y1, f x2 y2, f x3 y3..]
zipWith is right-lazy:>>> let f = undefined >>> zipWith f [] undefined []
zipWith is capable of list fusion, but it is restricted to its first list argument and its resulting list.Examples
zipWith (+) can be applied to two lists to produce the list of corresponding sums:>>> zipWith (+) [1, 2, 3] [4, 5, 6] [5,7,9]
>>> zipWith (++) ["hello ", "foo"] ["world!", "bar"] ["hello world!","foobar"]
zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]ghc-internal GHC.Internal.List zipWith generalises zip by zipping with the function given as the first argument, instead of a tupling function.
zipWith (,) xs ys == zip xs ys zipWith f [x1,x2,x3..] [y1,y2,y3..] == [f x1 y1, f x2 y2, f x3 y3..]
zipWith is right-lazy:>>> let f = undefined >>> zipWith f [] undefined []
zipWith is capable of list fusion, but it is restricted to its first list argument and its resulting list.Examples
zipWith (+) can be applied to two lists to produce the list of corresponding sums:>>> zipWith (+) [1, 2, 3] [4, 5, 6] [5,7,9]
>>> zipWith (++) ["hello ", "foo"] ["world!", "bar"] ["hello world!","foobar"]
zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]protolude Protolude zipWith generalises zip by zipping with the function given as the first argument, instead of a tupling function.
zipWith (,) xs ys == zip xs ys zipWith f [x1,x2,x3..] [y1,y2,y3..] == [f x1 y1, f x2 y2, f x3 y3..]
zipWith is right-lazy:>>> let f = undefined >>> zipWith f [] undefined []
zipWith is capable of list fusion, but it is restricted to its first list argument and its resulting list.Examples
zipWith (+) can be applied to two lists to produce the list of corresponding sums:>>> zipWith (+) [1, 2, 3] [4, 5, 6] [5,7,9]
>>> zipWith (++) ["hello ", "foo"] ["world!", "bar"] ["hello world!","foobar"]
zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]numeric-prelude NumericPrelude zipWith generalises zip by zipping with the function given as the first argument, instead of a tupling function.
zipWith (,) xs ys == zip xs ys zipWith f [x1,x2,x3..] [y1,y2,y3..] == [f x1 y1, f x2 y2, f x3 y3..]
zipWith is right-lazy:>>> let f = undefined >>> zipWith f [] undefined []
zipWith is capable of list fusion, but it is restricted to its first list argument and its resulting list.Examples
zipWith (+) can be applied to two lists to produce the list of corresponding sums:>>> zipWith (+) [1, 2, 3] [4, 5, 6] [5,7,9]
>>> zipWith (++) ["hello ", "foo"] ["world!", "bar"] ["hello world!","foobar"]
zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]numeric-prelude NumericPrelude.Base zipWith generalises zip by zipping with the function given as the first argument, instead of a tupling function.
zipWith (,) xs ys == zip xs ys zipWith f [x1,x2,x3..] [y1,y2,y3..] == [f x1 y1, f x2 y2, f x3 y3..]
zipWith is right-lazy:>>> let f = undefined >>> zipWith f [] undefined []
zipWith is capable of list fusion, but it is restricted to its first list argument and its resulting list.Examples
zipWith (+) can be applied to two lists to produce the list of corresponding sums:>>> zipWith (+) [1, 2, 3] [4, 5, 6] [5,7,9]
>>> zipWith (++) ["hello ", "foo"] ["world!", "bar"] ["hello world!","foobar"]
zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]numeric-prelude NumericPrelude.List.Checked Zip two lists which must be of the same length. This is checked only lazily, that is unequal lengths are detected only if the list is evaluated completely. But it is more strict than zipWithPad undefined f since the latter one may succeed on unequal length list if f is lazy.