Skip to content

Instantly share code, notes, and snippets.

@shigemk2 shigemk2/zipWith.hs
Created Jan 21, 2015

Embed
What would you like to do?
zipWith' :: (a -> b -> c) -> [a] -> [b] -> [c]
zipWith' _ [] _ = []
zipWith' _ _ [] = []
zipWith' f (x:xs) (y:ys) = f x y : zipWith' f xs ys
main = do
print $ zipWith' (+) [4,2,5,6] [2,4,1,0]
print $ zipWith' max [4,2,5,6] [2,4,1,0]
print $ zipWith' (*) (replicate 5 2) [1..]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.