到目前为止,我有:
miZipWith f [] [] = []
miZipWith f (x:xs) [] = []
miZipWith f [] (y:ys) = []
miZipWith f (x:xs) (y:ys) = f y: miZipWith f xs ys
----miZipWith f (x:xs) (y:ys) = f x : f y : miZipWith f xs ys
Run Code Online (Sandbox Code Playgroud)
但这只是用第二个列表"拉上"函数f.我如何包含第一个列表?
*Main> miZipWith (*2) [1,2,3,4] [5,6,1]
[10,12,2]
Run Code Online (Sandbox Code Playgroud)