Last active
December 24, 2015 16:02
-
-
Save tanishiking/9d680c0c86e8c3862cd0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object FibGen { | |
def main(args: Array[String]): Unit = { | |
fibGen.take(10).print | |
} | |
private[this] lazy val fibGen: Stream[Int] = 0 #:: 1 #:: fibGen.zip(fibGen.tail).map(n => n._1 + n._2) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment