Loops as tail-recursive functions

FYI.

I wrote a small piece on writing loops as tail-recursive function:

http://www.ats-lang.org/EXAMPLE/EFFECTIVATS/loop-as-tailrec

Cheers!