@@ -31,5 +31,96 @@ interface IStreamBuilder {
3131 mapper(values[0 ] as T1 , values[1 ] as T2 )
3232 }
3333
34+ fun <T1 , T2 , T3 , R > zip (
35+ source1 : IStream .One <T1 >,
36+ source2 : IStream .One <T2 >,
37+ source3 : IStream .One <T3 >,
38+ mapper : (T1 , T2 , T3 ) -> R ,
39+ ): IStream .One <R > = IStream .zip(listOf (source1, source2, source3)) { values ->
40+ @Suppress(" UNCHECKED_CAST" )
41+ mapper(values[0 ] as T1 , values[1 ] as T2 , values[2 ] as T3 )
42+ }
43+
44+ fun <T1 , T2 , T3 , T4 , R > zip (
45+ source1 : IStream .One <T1 >,
46+ source2 : IStream .One <T2 >,
47+ source3 : IStream .One <T3 >,
48+ source4 : IStream .One <T4 >,
49+ mapper : (T1 , T2 , T3 , T4 ) -> R ,
50+ ): IStream .One <R > = IStream .zip(listOf (source1, source2, source3, source4)) { values ->
51+ @Suppress(" UNCHECKED_CAST" )
52+ mapper(values[0 ] as T1 , values[1 ] as T2 , values[2 ] as T3 , values[3 ] as T4 )
53+ }
54+
55+ fun <T1 , T2 , T3 , T4 , T5 , R > zip (
56+ source1 : IStream .One <T1 >,
57+ source2 : IStream .One <T2 >,
58+ source3 : IStream .One <T3 >,
59+ source4 : IStream .One <T4 >,
60+ source5 : IStream .One <T5 >,
61+ mapper : (T1 , T2 , T3 , T4 , T5 ) -> R ,
62+ ): IStream .One <R > = IStream .zip(listOf (source1, source2, source3, source4, source5)) { values ->
63+ @Suppress(" UNCHECKED_CAST" )
64+ mapper(values[0 ] as T1 , values[1 ] as T2 , values[2 ] as T3 , values[3 ] as T4 , values[4 ] as T5 )
65+ }
66+
67+ fun <T1 , T2 , T3 , T4 , T5 , T6 , R > zip (
68+ source1 : IStream .One <T1 >,
69+ source2 : IStream .One <T2 >,
70+ source3 : IStream .One <T3 >,
71+ source4 : IStream .One <T4 >,
72+ source5 : IStream .One <T5 >,
73+ source6 : IStream .One <T6 >,
74+ mapper : (T1 , T2 , T3 , T4 , T5 , T6 ) -> R ,
75+ ): IStream .One <R > = IStream .zip(listOf (source1, source2, source3, source4, source5, source6)) { values ->
76+ @Suppress(" UNCHECKED_CAST" )
77+ mapper(values[0 ] as T1 , values[1 ] as T2 , values[2 ] as T3 , values[3 ] as T4 , values[4 ] as T5 , values[5 ] as T6 )
78+ }
79+
80+ fun <T1 , T2 , T3 , T4 , T5 , T6 , T7 , R > zip (
81+ source1 : IStream .One <T1 >,
82+ source2 : IStream .One <T2 >,
83+ source3 : IStream .One <T3 >,
84+ source4 : IStream .One <T4 >,
85+ source5 : IStream .One <T5 >,
86+ source6 : IStream .One <T6 >,
87+ source7 : IStream .One <T7 >,
88+ mapper : (T1 , T2 , T3 , T4 , T5 , T6 , T7 ) -> R ,
89+ ): IStream .One <R > = IStream .zip(listOf (source1, source2, source3, source4, source5, source6, source7)) { values ->
90+ @Suppress(" UNCHECKED_CAST" )
91+ mapper(values[0 ] as T1 , values[1 ] as T2 , values[2 ] as T3 , values[3 ] as T4 , values[4 ] as T5 , values[5 ] as T6 , values[6 ] as T7 )
92+ }
93+
94+ fun <T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , R > zip (
95+ source1 : IStream .One <T1 >,
96+ source2 : IStream .One <T2 >,
97+ source3 : IStream .One <T3 >,
98+ source4 : IStream .One <T4 >,
99+ source5 : IStream .One <T5 >,
100+ source6 : IStream .One <T6 >,
101+ source7 : IStream .One <T7 >,
102+ source8 : IStream .One <T8 >,
103+ mapper : (T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 ) -> R ,
104+ ): IStream .One <R > = IStream .zip(listOf (source1, source2, source3, source4, source5, source6, source7, source8)) { values ->
105+ @Suppress(" UNCHECKED_CAST" )
106+ mapper(values[0 ] as T1 , values[1 ] as T2 , values[2 ] as T3 , values[3 ] as T4 , values[4 ] as T5 , values[5 ] as T6 , values[6 ] as T7 , values[7 ] as T8 )
107+ }
108+
109+ fun <T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 , R > zip (
110+ source1 : IStream .One <T1 >,
111+ source2 : IStream .One <T2 >,
112+ source3 : IStream .One <T3 >,
113+ source4 : IStream .One <T4 >,
114+ source5 : IStream .One <T5 >,
115+ source6 : IStream .One <T6 >,
116+ source7 : IStream .One <T7 >,
117+ source8 : IStream .One <T8 >,
118+ source9 : IStream .One <T9 >,
119+ mapper : (T1 , T2 , T3 , T4 , T5 , T6 , T7 , T8 , T9 ) -> R ,
120+ ): IStream .One <R > = IStream .zip(listOf (source1, source2, source3, source4, source5, source6, source7, source8, source9)) { values ->
121+ @Suppress(" UNCHECKED_CAST" )
122+ mapper(values[0 ] as T1 , values[1 ] as T2 , values[2 ] as T3 , values[3 ] as T4 , values[4 ] as T5 , values[5 ] as T6 , values[6 ] as T7 , values[7 ] as T8 , values[8 ] as T9 )
123+ }
124+
34125 fun <T > singleFromCoroutine (block : suspend CoroutineScope .() -> T ): IStream .One <T >
35126}
0 commit comments