Skip to content

Instantly share code, notes, and snippets.

@fpopic
Created September 19, 2018 13:29
Show Gist options
  • Save fpopic/2152cff2051e7e121556c2b6b2c43a84 to your computer and use it in GitHub Desktop.
Save fpopic/2152cff2051e7e121556c2b6b2c43a84 to your computer and use it in GitHub Desktop.
scala> Seq(1,2,3).map{x=>println(x); x*100}.map{x=>println(x); x/10}
1
2
3
100
200
300
res5: Seq[Int] = List(10, 20, 30)
scala> Seq(1,2,3).view.map{x=>println(x); x*100}.map{x=>println(x); x/10}.force
1
100
2
200
3
300
res6: Seq[Int] = List(10, 20, 30)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment