A common misconception about functional languages is that they are slow, and that function calls is inherently slow compared to looping. However, most functional languages, and now Elm, provide a way for you to write loops: tail-recursion.
When you define a function, you will usually call other functions to build a return value. But sometimes, you directly return the value returned by another function. This is called a tail call.
Specifically, a an expression is in tail position if it is the body of the function, or if it is in tail position of the result of an if or case statement that is in tail position. Function calls made to calculate argument parameters, or used in the right-hand side of a let declaration, are not in tail position.