Created
January 21, 2015 11:43
-
-
Save shigemk2/a8815778adc767219d71 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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