I defined a function to return Fibonacci stream as follows:
def fib:Stream[Int] = { Stream.cons(1, Stream.cons(2, (fib zip fib.tail) map {case (x, y)
You can do it the other way:
lazy val fibs = { def f(a: Int, b: Int): Stream[Int] = a #:: f(b, a + b) f(0, 1) }