Skip to content

Instantly share code, notes, and snippets.

@Refefer
Created December 19, 2013 05:12
Show Gist options
  • Save Refefer/8034728 to your computer and use it in GitHub Desktop.
Save Refefer/8034728 to your computer and use it in GitHub Desktop.
def fib: Stream[Int] = {
def loop(i:Int, j:Int):Stream[Int] = {
j #:: loop(j, i+j)
}
loop(1,1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment