Created
March 8, 2016 18:43
-
-
Save vlastachu/18d2492b3ac5da3e7682 to your computer and use it in GitHub Desktop.
version of zipWith with number of iteration
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
zipWithIterNum :: (Integer -> a -> b -> c) -> [a] -> [b] -> [c] | |
zipWithIterNum fun l r = zipWithIterNum' 0 l r | |
where n = length l | |
zipWithIterNum' _ [] _ = [] | |
zipWithIterNum' _ _ [] = [] | |
zipWithIterNum' i (x:xs) (y:ys) = (fun i x y):(zipWithIterNum' (i + 1) xs ys ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment