Just like a function letter:
(x:Int) => x + 1
is a function of one argument, the following
(x:Int, y: Int, z: Int) => x + y + z
is a function of three arguments, not a single argument 3tuple
You can do this work neatly with the case :
scala> val c: Stream[(Int,Int,Int)] = Stream.iterate((1, 0, 1)){ case (a, b, c) => (b, c, a+b) } c: Stream[(Int, Int, Int)] = Stream((1,0,1), ?)
An alternative is passing a tuple, but it is really ugly due to all _1 accessories:
scala> val c:Stream[(Int,Int,Int)] = Stream.iterate((1, 0, 1))( t => (t._2, t._3, t._1 + t._2) ) c: Stream[(Int, Int, Int)] = Stream((1,0,1), ?)