Skip to content

Instantly share code, notes, and snippets.

@lhohan
Created February 16, 2014 18:11
Show Gist options
  • Save lhohan/9038316 to your computer and use it in GitHub Desktop.
Save lhohan/9038316 to your computer and use it in GitHub Desktop.
def fibFrom(a: Int, b: Int): Stream[Int] = a #:: fibFrom(b, a + b)
def fibonacciStream(n: Int) = fibFrom(1, 1).take(n).toList.last
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment