As you already know, for the sake of immutability you can't process data using for loops and while loops. So we have recursive functions to rescue.