This is my first blog ever so thanks for reading it 🙂 Hopefully, this will be a place of fun, scala and discussions. From time to time I have some code which is useless but interesting, useful but tricky or simply fun to look at and run. I hope to put up some of this code for anyone to enjoy or discuss. It’s gonna be exciting to see if you show up, Internet!
Today I will simply treat you to my favorite definition of the fibonacci sequence in Scala:
def f(a:Int,b:Int):Stream[Int] = a #:: f(b,a+b)
def fib = f(1,1)
What do you think of the fact that Scala doesn’t do type inference for recursive functions?