使用数组参数Single.zip()版本我丢失了强类型参数。
我不能发送可为空的源值作为函数的Single.zip()参数
Object[]不输入的方法的替代方法:public static <T, R> Single<R> zipArray(Function<? super Object[], ? extends R> zipper, SingleSource<? extends T>... sources) ...
Run Code Online (Sandbox Code Playgroud)
在haskell中,有一个相关的问题如何在Haskell中实现通用的“zipn”和“unzipn”?:
在 haskell 中,我可以使用 applicative functors 来实现这一点:
f <$> a1 <*> a2 <*> a3 <*> a4 <*> a5 <*> a6 <*> a7 <*> a8 <*> a9 <*> a10 <*> a11
Run Code Online (Sandbox Code Playgroud)
存在 f :: Int -> Int -> Int -> Int -> …
我在基本的Haskell库中找到了这个文档:
zip :: [a] -> [b] -> [(a, b)]
zip takes two lists and returns a list of corresponding pairs. If one input list is short, excess elements of the longer list are discarded.
zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
zip3 takes three lists and returns a list of triples, analogous to zip.
zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
The zip4 function takes four lists and returns …Run Code Online (Sandbox Code Playgroud)