@@ -228,9 +228,10 @@ object Test {
228
228
Linear (zip_producer(producer1, producer2))
229
229
230
230
case (Linear (producer1), Nested (producer2, nestf2)) =>
231
- pushLinear(producer1, producer2, nestf2)
231
+ pushLinear[ A , _, B ] (producer1, producer2, nestf2)
232
232
233
- case (Nested (producer1, nestf1), Linear (producer2)) => ???
233
+ case (Nested (producer1, nestf1), Linear (producer2)) =>
234
+ mapRaw[(B , A ), (A , B )]((t => k => ' { ~ k((t._2, t._1)) }), pushLinear[B , _, A ](producer2, producer1, nestf1))
234
235
235
236
case (Nested (producer1, nestf1), Nested (producer2, nestf2)) => ???
236
237
}
@@ -376,6 +377,11 @@ object Test {
376
377
.zip(((a : Expr [Int ]) => (b : Expr [Int ]) => ' { ~ a + ~ b }), Stream .of(' {Array (1 , 2 , 3 )}).flatMap((d : Expr [Int ]) => Stream .of(' {Array (1 , 2 , 3 )}).map((dp : Expr [Int ]) => ' { ~ d + ~ dp })))
377
378
.fold(' {0 }, ((a : Expr [Int ], b : Expr [Int ]) => ' { ~ a + ~ b }))
378
379
380
+ def test9 () = Stream
381
+ .of(' {Array (1 , 2 , 3 )}).flatMap((d : Expr [Int ]) => Stream .of(' {Array (1 , 2 , 3 )}).map((dp : Expr [Int ]) => ' { ~ d + ~ dp }))
382
+ .zip(((a : Expr [Int ]) => (b : Expr [Int ]) => ' { ~ a + ~ b }), Stream .of(' {Array (1 , 2 , 3 )}) )
383
+ .fold(' {0 }, ((a : Expr [Int ], b : Expr [Int ]) => ' { ~ a + ~ b }))
384
+
379
385
def main (args : Array [String ]): Unit = {
380
386
println(test1().run)
381
387
println
@@ -392,6 +398,8 @@ object Test {
392
398
println(test7().run)
393
399
println
394
400
println(test8().run)
401
+ println
402
+ println(test9().run)
395
403
}
396
404
}
397
405
0 commit comments