How to define zipWith by using zip and list comprehension

Published: 17/10/2019
How to define zipWith by using zip and list comprehension
Source: STACKOVERFLOW.COM

I am trying to write zipWith function using zip and list comprehension. I need to zip the two lists after the function is applied. However I don't know where to use the list comprehension. I tried doing two list comprehensions for each list. zipWith' :: (a -> b -> c) -> [a] -> [b] -> [c] zipWith' f xs ys = zip [f x | x <- xs] [f y | y <- ys] I am expecting the function to b

Read more
Related news
Comment
FACEBOOK