@@ -40,7 +40,7 @@ object Test {
40
40
case class Linear [A ](producer : Producer [A ]) extends StagedStream [A ]
41
41
case class Nested [A , B ](producer : Producer [B ], nestedf : B => StagedStream [A ]) extends StagedStream [A ]
42
42
43
- case class Stream [A ](stream : StagedStream [Expr [A ]]) {
43
+ case class Stream [A : Type ](stream : StagedStream [Expr [A ]]) {
44
44
45
45
def fold [W : Type ](z : Expr [W ], f : ((Expr [W ], Expr [A ]) => Expr [W ])): Expr [W ] = {
46
46
Var (z) { s : Var [W ] => ' {
@@ -101,7 +101,7 @@ object Test {
101
101
* @tparam B the element type of the resulting stream
102
102
* @return a new stream resulting from applying `f` in the `step` function of the input stream's producer.
103
103
*/
104
- private def mapRaw [A , B ](f : (A => (B => Expr [Unit ]) => Expr [Unit ]), stream : StagedStream [A ]): StagedStream [B ] = {
104
+ private def mapRaw [A : Type , B : Type ](f : (A => (B => Expr [Unit ]) => Expr [Unit ]), stream : StagedStream [A ]): StagedStream [B ] = {
105
105
stream match {
106
106
case Linear (producer) => {
107
107
val prod = new Producer [B ] {
@@ -194,7 +194,7 @@ object Test {
194
194
* @return the stream with the new producer. If the passed stream was linear, the new termination is added
195
195
* otherwise the new termination is propagated to all nested ones, recursively.
196
196
*/
197
- private def addTerminationCondition [A ](condition : Expr [Boolean ] => Expr [Boolean ], stream : StagedStream [A ]): StagedStream [A ] = {
197
+ private def addTerminationCondition [A : Type ](condition : Expr [Boolean ] => Expr [Boolean ], stream : StagedStream [A ]): StagedStream [A ] = {
198
198
def addToProducer [A ](f : Expr [Boolean ] => Expr [Boolean ], producer : Producer [A ]): Producer [A ] = {
199
199
producer.card match {
200
200
case Many =>
@@ -267,7 +267,7 @@ object Test {
267
267
* @tparam A the type of the producer's elements.
268
268
* @return a linear or nested stream aware of the variable reference to decrement.
269
269
*/
270
- private def takeRaw [A ](n : Expr [Int ], stream : StagedStream [A ]): StagedStream [A ] = {
270
+ private def takeRaw [A : Type ](n : Expr [Int ], stream : StagedStream [A ]): StagedStream [A ] = {
271
271
stream match {
272
272
case linear : Linear [A ] => {
273
273
val enhancedProducer : Producer [(Var [Int ], A )] = addCounter[A ](n, linear.producer)
@@ -298,7 +298,7 @@ object Test {
298
298
/** A stream containing the first `n` elements of this stream. */
299
299
def take (n : Expr [Int ]): Stream [A ] = Stream (takeRaw[Expr [A ]](n, stream))
300
300
301
- private def zipRaw [A , B ](stream1 : StagedStream [A ], stream2 : StagedStream [B ]): StagedStream [(A , B )] = {
301
+ private def zipRaw [A : Type , B : Type ](stream1 : StagedStream [A ], stream2 : StagedStream [B ]): StagedStream [(A , B )] = {
302
302
(stream1, stream2) match {
303
303
304
304
case (Linear (producer1), Linear (producer2)) =>
@@ -321,7 +321,7 @@ object Test {
321
321
* @tparam A
322
322
* @return
323
323
*/
324
- private def makeLinear [A ](stream : StagedStream [A ]): StagedStream [A ] = {
324
+ private def makeLinear [A : Type ](stream : StagedStream [A ]): StagedStream [A ] = {
325
325
stream match {
326
326
case Linear (producer) => stream
327
327
case Nested (producer, nestedf) => {
@@ -406,7 +406,7 @@ object Test {
406
406
}
407
407
}
408
408
409
- private def pushLinear [A , B , C ](producer : Producer [A ], nestedProducer : Producer [B ], nestedf : (B => StagedStream [C ])): StagedStream [(A , C )] = {
409
+ private def pushLinear [A : Type , B , C : Type ](producer : Producer [A ], nestedProducer : Producer [B ], nestedf : (B => StagedStream [C ])): StagedStream [(A , C )] = {
410
410
val newProducer = new Producer [(Var [Boolean ], producer.St , B )] {
411
411
412
412
type St = (Var [Boolean ], producer.St , nestedProducer.St )
@@ -440,7 +440,7 @@ object Test {
440
440
})
441
441
}
442
442
443
- private def zip_producer [A , B ](producer1 : Producer [A ], producer2 : Producer [B ]) = {
443
+ private def zip_producer [A : Type , B : Type ](producer1 : Producer [A ], producer2 : Producer [B ]) = {
444
444
new Producer [(A , B )] {
445
445
446
446
type St = (producer1.St , producer2.St )
0 commit comments