Slide 118
Slide 118 text
scala-ildl.org
Deforestation
Deforestation
List(1,2,3).map(_ + 1).map(_ * 2).sum
List(2,3,4) List(4,6,8) 18
transform(ListDeforestation) {
List(1,2,3).map(_ + 1).map(_ * 2).sum
}
accumulate
function
accumulate
function
compute:
18
6x faster