Skip to content

Instantly share code, notes, and snippets.

View pmatiello's full-sized avatar

Pedro Matiello pmatiello

View GitHub Profile
@pmatiello
pmatiello / Streams.scala
Created December 9, 2011 02:43
Scala Streams
object Streams {
def main(args: Array[String]) {
val list = fibonacci()
(list take 20) foreach println
}
private def eagerNaturals() = {
def naturals(n: Int): List[Int] = n :: naturals(n + 1)
naturals(0)