lazy lists? easy
Feb. 7th, 2015 11:30 am![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
scala>val input = for {i <- 1 to 10 view; _ = println(s"--$i--")} yield i scala> input find (5==) --1-- --2-- --3-- --4-- --5-- res3: Option[Int] = Some(5)
That's how laziness is achieved, just add
view
in the right place