I wrote some awkward Fibonacci implementation just to test out Stream
def fibonacci(a : Int, b : Int) : Stream[Int] = Stream(a, b) ++ fibonacci(a + b, a + b * 2)
I know this is not the best implementation but couldn't figure out why this would stack overflow on any call to it, say fibonacci(0, 1) take(1)?
Thanks.