|
|
|
|
|
by zokier
3498 days ago
|
|
I'm not sure I get what's the difference between for example: def filterFilterTest (xs : Rep[Array[Int]]) : Rep[Int] =
Stream[Int](xs)
.filter(d => d % 2 == 0)
.filter(d => d % 3 == 0)
.fold(unit(0), ((a : Rep[Int]) => (b : Rep[Int]) => a + b))
and xs.filter(d => d % 2 == 0).filter(d => d % 3 == 0).fold(0)(_+_)
(grabbed from unit tests here: https://github.com/strymonas/staged-streams.scala/blob/maste... )They both look pretty much the same and superficially do the same thing too, so what makes this new thing better/novel? |
|